{"id":"CVE-2026-55254","aliases":["EUVD-2026-45304","GHSA-3w5p-95mh-gq75"],"status":"published","title":"NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation","description":"NCalc is a fast, lightweight expression evaluator for .NET. Prior to 6.1.1, the factorial operator implementation in src/NCalc.Core/Helpers/MathHelper.cs permits specially crafted expressions with extremely large factorial operands, causing excessive CPU consumption or a non-terminating loop due to integer overflow in the factorial calculation logic when applications evaluate untrusted expressions. This issue is fixed in version 6.1.1.","severity":{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00292,"percentile":0.21933,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-190","CWE-770"],"published":"2026-06-18T13:05:37Z","modified":"2026-10-28T02:30:33Z","fixes":[{"ecosystem":"NuGet","package":"NCalc.Core","fixed_in":["6.1.1"],"sources":["ghsa","osv"]},{"ecosystem":"NuGet","package":"NCalcSync","fixed_in":["6.1.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"NuGet","package":"NCalc.Core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.1.1"}]}]},{"source":"ghsa","ecosystem":"NuGet","package":"NCalcSync","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.1.1"}]}]},{"source":"osv","ecosystem":"NuGet","package":"NCalc.Core","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.1.1"}]}],"versions":["4.3.0","4.3.1","4.3.2","4.3.3","4.4.0-alpha","5.0.0","5.1.0","5.10.0","5.11.0","5.12.0","5.13.0","5.2.0","5.2.1","5.2.10","5.2.11","5.2.2","5.2.3","5.2.4","5.2.5","5.2.6","5.2.7","5.2.8","5.2.9","5.3.0","5.3.1","5.4.0","5.4.1","5.4.2","5.5.0","5.5.0-alpha","5.6.0","5.7.0","5.8.0","5.9.0","6.0.0","6.1.0"]},{"source":"osv","ecosystem":"NuGet","package":"NCalcSync","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.1.1"}]}],"versions":["2.0.0","3.0.0","3.1.0","3.10.0","3.11.0","3.12.0","3.13.0","3.13.1","3.2.0","3.3.0","3.4.0","3.5.0","3.6.0","3.7.0","3.8.0","3.9.0","4.0.0","4.1.0","4.2.0","4.2.1","4.3.0","4.3.1","4.3.2","4.3.3","4.4.0-alpha","5.0.0","5.1.0","5.10.0","5.11.0","5.12.0","5.13.0","5.2.0","5.2.1","5.2.10","5.2.11","5.2.2","5.2.3","5.2.4","5.2.5","5.2.6","5.2.7","5.2.8","5.2.9","5.3.0","5.3.1","5.4.0","5.4.1","5.4.2","5.5.0","5.5.0-alpha","5.6.0","5.7.0","5.8.0","5.9.0","6.0.0","6.1.0"]}],"products":[{"vendor":"ncalc","product":"ncalc"}],"references":[{"url":"https://github.com/ncalc/ncalc/security/advisories/GHSA-3w5p-95mh-gq75","tags":["x_refsource_CONFIRM","Patch","Vendor Advisory","advisory","web"]},{"url":"https://github.com/ncalc/ncalc/pull/575","tags":["x_refsource_MISC","Issue Tracking","Patch","fix","web"]},{"url":"https://github.com/ncalc/ncalc/commit/eeb6155ee1899b1fdf2cda3da35a4f0ca93ffd6a","tags":["x_refsource_MISC","Patch","fix"]},{"url":"https://github.com/ncalc/ncalc/releases/tag/v6.1.1","tags":["x_refsource_MISC","Product","Release Notes","web"]},{"url":"https://github.com/advisories/GHSA-3w5p-95mh-gq75"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/55xxx/CVE-2026-55254.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55254","tags":["advisory"]},{"url":"https://github.com/ncalc/ncalc","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-55254","title":"NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation","description":"NCalc is a fast, lightweight expression evaluator for .NET. Prior to 6.1.1, the factorial operator implementation in src/NCalc.Core/Helpers/MathHelper.cs permits specially crafted expressions with extremely large factorial operands, causing excessive CPU consumption or a non-terminating loop due to integer overflow in the factorial calculation logic when applications evaluate untrusted expressions. This issue is fixed in version 6.1.1.","status":"published","published":"2026-07-17T19:55:16.728Z","modified":"2026-07-20T18:07:31.078Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna"}],"cwes":["CWE-770","CWE-190"],"updated_at":"2026-11-02T14:20:11.925815Z"}],"euvd":[{"id":"EUVD-2026-45304","description":"NCalc is a fast, lightweight expression evaluator for .NET. Prior to 6.1.1, the factorial operator implementation in src/NCalc.Core/Helpers/MathHelper.cs permits specially crafted expressions with extremely large factorial operands, causing excessive CPU consumption or a non-terminating loop due to integer overflow in the factorial calculation logic when applications evaluate untrusted expressions. This issue is fixed in version 6.1.1.","status":"published","published":"2026-07-17T19:55:16Z","modified":"2026-07-20T18:07:31Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T18:19:48.530346Z"}],"ghsa":[{"id":"GHSA-3w5p-95mh-gq75","title":"NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation","description":"### 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.","status":"published","published":"2026-06-18T13:05:37Z","modified":"2026-06-18T13:05:39Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-190","CWE-770"],"updated_at":"2026-11-02T14:40:29.43528Z"}],"nvd":[{"id":"CVE-2026-55254","description":"NCalc is a fast, lightweight expression evaluator for .NET. Prior to 6.1.1, the factorial operator implementation in src/NCalc.Core/Helpers/MathHelper.cs permits specially crafted expressions with extremely large factorial operands, causing excessive CPU consumption or a non-terminating loop due to integer overflow in the factorial calculation logic when applications evaluate untrusted expressions. This issue is fixed in version 6.1.1.","status":"published","published":"2026-07-17T20:17:27.023Z","modified":"2026-08-18T15:44:07.357Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium","assessor":"secondary"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"primary"}],"cwes":["CWE-190","CWE-770"],"updated_at":"2026-11-02T14:12:30.631352Z"}],"osv":[{"id":"CVE-2026-55254","title":"NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation","description":"NCalc is a fast, lightweight expression evaluator for .NET. Prior to 6.1.1, the factorial operator implementation in src/NCalc.Core/Helpers/MathHelper.cs permits specially crafted expressions with extremely large factorial operands, causing excessive CPU consumption or a non-terminating loop due to integer overflow in the factorial calculation logic when applications evaluate untrusted expressions. This issue is fixed in version 6.1.1.","status":"published","published":"2026-07-17T19:55:16.728Z","modified":"2026-10-28T02:30:33.271316214Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-190","CWE-770"],"updated_at":"2026-11-02T15:45:11.22012Z"},{"id":"GHSA-3w5p-95mh-gq75","title":"NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation","description":"### 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.","status":"published","published":"2026-06-18T13:05:37Z","modified":"2026-06-18T13:26:30.567364Z","cvss":[{"version":"3.1","score":4.8,"vector":"CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-190","CWE-770"],"updated_at":"2026-11-02T15:46:36.092962Z"}]}}
