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 (CVSS)
| Base score | 4.8 |
|---|---|
| Severity | Medium |
| Version | CVSS 3.1 |
| Vector | CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H |
| Provided by | CNA |
Weaknesses
- CWE-770 — CWE-770: Allocation of Resources Without Limits or Throttling
- CWE-190 — CWE-190: Integer Overflow or Wraparound
Affected products
| Vendor | Product | Versions |
|---|---|---|
| ncalc | ncalc | < 6.1.1 |
References
- https://github.com/ncalc/ncalc/security/advisories/GHSA-3w5p-95mh-gq75 (x_refsource_CONFIRM)
- https://github.com/ncalc/ncalc/pull/575 (x_refsource_MISC)
- https://github.com/ncalc/ncalc/commit/eeb6155ee1899b1fdf2cda3da35a4f0ca93ffd6a (x_refsource_MISC)
- https://github.com/ncalc/ncalc/releases/tag/v6.1.1 (x_refsource_MISC)
Generated from the official CVE List on 18 Jul 2026 07:00 UTC.