CVE-2026-55254

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

Published Jul 17, 2026 CVSS 3.1 · 4.8 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The NCalc expression evaluator computes factorials without bounds. In releases before 6.1.1, crafted expressions with very large factorial operands trigger infinite loops or extreme CPU usage because the factorial calculation overflows and never finishes. This results in a resource exhaustion denial‑of‑service condition. The flaw is a classic integer overflow and infinite loop bug (CWE‑190, CWE‑770). Applications that accept untrusted expressions processed by NCalc are directly vulnerable to this degradation.

Affected Systems

The affected product is NCalc from the ncalc vendor. Any deployment using NCalc versions earlier than 6.1.1 is vulnerable. The fix is applied in release 6.1.1, which can be downloaded from the project's releases page.

Risk and Exploitability

The CVSS score of 4.8 indicates a moderate impact, and the EPSS score of less than 1% suggests a low likelihood of widespread exploitation at this time. The vulnerability is not listed in CISA’s KEV catalog. The attack vector is inferred to be remote or local depending on whether the application feeds untrusted input to NCalc; any user or system component that can inject expressions may trigger the denial of service.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade NCalc to version 6.1.1 or later
  • In applications that accept arbitrary expressions, restrict or remove the factorial operator for untrusted inputs
  • Validate or filter expression lengths and complexity before evaluation
  • Add timeouts or resource limits around NCalc evaluation calls

Generated by OpenCVE AI on July 30, 2026 at 23:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-3w5p-95mh-gq75 NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation
History
Type Values Removed Values Added
CPEs cpe:2.3:a:ncalc:ncalc:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Ncalc
Ncalc ncalc
Vendors & Products Ncalc
Ncalc ncalc
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation
Weaknesses CWE-190
CWE-770
References
Metrics cvssV3_1

{'score': 4.8, 'vector': 'CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H'}

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

  • CWE-770

    Allocation of Resources Without Limits or Throttling

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 20, 2026, 6:07 PM
Reserved
Jun 16, 2026, 4:44 PM
Status
Analyzed
Published
Jul 17, 2026, 8:17 PM
Modified
Aug 18, 2026, 3:44 PM