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.
Published: 2026-07-17
Score: 4.8 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Thu, 23 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
First Time appeared Ncalc
Ncalc ncalc
Vendors & Products Ncalc
Ncalc ncalc

Mon, 20 Jul 2026 18:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 17 Jul 2026 20:15:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-20T18:07:31.078Z

Reserved: 2026-06-16T16:44:00.625Z

Link: CVE-2026-55254

cve-icon Vulnrichment

Updated: 2026-07-20T18:07:26.821Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-30T23:45:05Z

Weaknesses
  • CWE-190

    Integer Overflow or Wraparound

  • CWE-770

    Allocation of Resources Without Limits or Throttling