Every CVE Search/ Get API key

CVE-2026-55254

NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation

4.8 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Adjacent network
Complexity
High
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

0.29%Up 0.1 points since Jul 18, 2026
90%50%10%1%

What each source reports

CVE List Score used 4.8

NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation

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.

Record
CVE-2026-55254
CVSS 3.1
4.8 MediumCVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-770, CWE-190
Updated
2026-11-02
EUVDEUVD-2026-45304 4.8

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.

Record
EUVD-2026-45304
CVSS 3.1
4.8 MediumCVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-3w5p-95mh-gq75 4.8

NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation

Impact

A 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.

Applications that evaluate untrusted expressions using affected versions of NCalc may be vulnerable to resource exhaustion, potentially resulting in service disruption or application unresponsiveness.

This issue can be triggered with expressions such as:

99999999999999!
9223372036854775807!
1.5e16!

Patches

The vulnerability has been fixed by adding bounds validation for factorial operands and rejecting unsupported values before evaluation.

Users should upgrade to the first release containing the fix from pull request #575. (v6.1.1+)

Workarounds

If upgrading is not immediately possible:

  • Do not evaluate expressions originating from untrusted users.
  • Validate or sanitize expressions before evaluation and reject factorial operations on large values.
  • Implement execution time limits, request timeouts, or cancellation mechanisms around expression evaluation.

These mitigations may reduce exposure but do not fully address the underlying vulnerability.

Record
GHSA-3w5p-95mh-gq75
CVSS 3.1
4.8 MediumCVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-190, CWE-770
Updated
2026-11-02
NVD 4.8

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.

Record
CVE-2026-55254
CVSS 3.1
4.8 MediumCVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
CVSS 3.1
6.5 MediumCVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-190, CWE-770
Updated
2026-11-02
OSV 4.8

NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation

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.

Record
CVE-2026-55254
CVSS 3.1
4.8 MediumCVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-190, CWE-770
Updated
2026-11-02
OSVGHSA-3w5p-95mh-gq75 4.8

NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation

Impact

A 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.

Applications that evaluate untrusted expressions using affected versions of NCalc may be vulnerable to resource exhaustion, potentially resulting in service disruption or application unresponsiveness.

This issue can be triggered with expressions such as:

99999999999999!
9223372036854775807!
1.5e16!

Patches

The vulnerability has been fixed by adding bounds validation for factorial operands and rejecting unsupported values before evaluation.

Users should upgrade to the first release containing the fix from pull request #575. (v6.1.1+)

Workarounds

If upgrading is not immediately possible:

  • Do not evaluate expressions originating from untrusted users.
  • Validate or sanitize expressions before evaluation and reject factorial operations on large values.
  • Implement execution time limits, request timeouts, or cancellation mechanisms around expression evaluation.

These mitigations may reduce exposure but do not fully address the underlying vulnerability.

Record
GHSA-3w5p-95mh-gq75
CVSS 3.1
4.8 MediumCVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
Weakness
CWE-190, CWE-770
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
NCalc.Core
NuGet
before 6.1.1
6.1.1
NCalcSync
NuGet
before 6.1.1
6.1.1
NCalc.Core
NuGet
before 6.1.1, plus listed versions
4.3.04.3.14.3.24.3.34.4.0-alpha
Show 31 moreShow less
5.0.05.1.05.10.05.11.05.12.05.13.05.2.05.2.15.2.105.2.115.2.25.2.35.2.45.2.55.2.65.2.75.2.85.2.95.3.05.3.15.4.05.4.15.4.25.5.05.5.0-alpha5.6.05.7.05.8.05.9.06.0.06.1.0
6.1.1
NCalcSync
NuGet
before 6.1.1, plus listed versions
2.0.03.0.03.1.03.10.03.11.0
Show 45 moreShow less
3.12.03.13.03.13.13.2.03.3.03.4.03.5.03.6.03.7.03.8.03.9.04.0.04.1.04.2.04.2.14.3.04.3.14.3.24.3.34.4.0-alpha5.0.05.1.05.10.05.11.05.12.05.13.05.2.05.2.15.2.105.2.115.2.25.2.35.2.45.2.55.2.65.2.75.2.85.2.95.3.05.3.15.4.05.4.15.4.25.5.05.5.0-alpha
6.1.1

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-55254 is a medium vulnerability (CVSS 4.8) in Ncalc, published June 18, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.29%, the 21st percentile. Fixed in NCalc.Core 6.1.1.

References

This page doesn't list everything

Left out here: 6 versions. The JSON record has them.

MoveEnter Open