CVE-2026-142198: NCalc before 7.6.0 Uncontrolled Recursion Denial of Service via EvaluationVisitor
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 Software
Event History
Frequently Asked Questions
Which deployments are exposed?
Applications using NCalc versions before 7.6.0 are exposed when an attacker can supply expressions for evaluation. The affected input includes long flat chains of unary negation, factorial, or addition operators.
Does exploitation require authentication or user interaction?
No. The supplied vector indicates network access with no privileges required and no user interaction.
What is the operational impact of a successful attack?
A crafted expression can exhaust the thread stack in EvaluationVisitor and cause an uncatchable StackOverflowException. This terminates the host application process, producing a denial of service; the provided impact data indicates availability impact only.
What should be done if this component is in use?
Update NCalc to version 7.6.0 or later. Until updating is possible, restrict untrusted users from submitting expressions for evaluation, particularly expressions containing very long operator chains.