{"id":"CVE-2026-55254","title":"NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation","summary":"NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation","severity":"medium","cvss":4.8,"cwe":["CWE-190","CWE-770"],"vendor":"NCalc","product":"NCalc.Core","ecosystem":"nuget","affected":["NCalc.Core < 6.1.1","NCalcSync < 6.1.1"],"patched":["NCalc.Core 6.1.1","NCalcSync 6.1.1"],"published":"2026-06-18","updated":"2026-06-18","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-3w5p-95mh-gq75","references":[{"url":"https://github.com/ncalc/ncalc/security/advisories/GHSA-3w5p-95mh-gq75"},{"url":"https://github.com/ncalc/ncalc/pull/575"},{"url":"https://github.com/advisories/GHSA-3w5p-95mh-gq75"}],"tags":["ghsa","nuget"],"ingestedAt":"2026-06-29T14:31:47.006Z","epss":0.00191,"epssPercentile":0.09077,"slug":"CVE-2026-55254","body":"## Overview\n\n### Impact\n\nA denial-of-service (DoS) vulnerability exists in the factorial operator implementation of NCalc. Specially crafted expressions containing extremely large factorial operands can trigger excessive CPU consumption or cause evaluation to enter a non-terminating loop due to integer overflow in the factorial calculation logic.\n\nApplications that evaluate untrusted expressions using affected versions of NCalc may be vulnerable to resource exhaustion, potentially resulting in service disruption or application unresponsiveness.\n\nThis issue can be triggered with expressions such as:\n\n```text\n99999999999999!\n9223372036854775807!\n1.5e16!\n```\n\n### Patches\n\nThe vulnerability has been fixed by adding bounds validation for factorial operands and rejecting unsupported values before evaluation.\n\nUsers should upgrade to the first release containing the fix from pull request #575. (**v6.1.1+**)\n\n### Workarounds\n\nIf upgrading is not immediately possible:\n\n* Do not evaluate expressions originating from untrusted users.\n* Validate or sanitize expressions before evaluation and reject factorial operations on large values.\n* Implement execution time limits, request timeouts, or cancellation mechanisms around expression evaluation.\n\nThese mitigations may reduce exposure but do not fully address the underlying vulnerability.\n\n## Affected packages\n\n- `NCalc.Core < 6.1.1`\n- `NCalcSync < 6.1.1`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `NCalc.Core 6.1.1`\n- `NCalcSync 6.1.1`","depth":"sunlit","depthScore":26,"depthScoreParts":{"impact":26.4,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}