Description
NCalc before 7.6.0 contains an uncontrolled recursion vulnerability that allows attackers to crash the host process by supplying long flat chains of operators. Attackers can submit an expression of a few thousand chained unary negation, factorial, or addition terms that recursively exhausts the thread stack in EvaluationVisitor, triggering an uncatchable StackOverflowException that terminates the application.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| ncalc | ncalc | 0 <7.6.0 | — |
References
- https://github.com/ncalc/ncalc/blob/v7.5.0/src/NCalc.Core/Visitors/EvaluationVisitor.cs#L69-L74
- https://github.com/ncalc/ncalc/pull/657
- https://github.com/ncalc/ncalc/commit/f1c03383ff87d7599b881713dd62fecaac1d4b8e
- https://github.com/ncalc/ncalc/releases/tag/v7.6.0
- https://www.vulncheck.com/advisories/ncalc-before-7.6.0-uncontrolled-recursion-denial-of-service-via-evaluationvisitor