Vulnerabilities in pkg:nuget/NCalc.Core

PACKAGE
Advisory Identifier: GHSA-3w5p-95mh-gq75
Advisory Summary

CVE-2026-55254 is a MODERATE (CVSS 4.8) denial of service vulnerability (CWE-190: Integer Overflow or Wraparound) affecting NCalc libraries in the NuGet ecosystem. The issue involves denial of service via unbounded and non-terminating factorial evaluation. Remediation is available by upgrading affected packages to version 6.1.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:nuget/NCalc.Core

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:nuget/NCalc.Core. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-3w5p-95mh-gq75 CVE-2026-55254 MODERATE NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation

CVE-2026-55254 at a Glance

CVE Identifier CVE-2026-55254
GHSA Identifier GHSA-3w5p-95mh-gq75
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-190: Integer Overflow or Wraparound
Affected Product NCalc
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 4.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H).

Attack Vector Adjacent (AV:A)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-55254

To remediate this vulnerability, upgrade all affected NCalc dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

NCalc.Core fixed: 6.1.1
Upgrade NCalc.Core to 6.1.1
NCalcSync fixed: 6.1.1
Upgrade NCalcSync to 6.1.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for NCalc.Core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-55254, inspect your project dependencies for NCalc:

inspect dependencies for NCalc.Core

Analyze the terminal output to locate any version of NCalc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.1.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In NCalc, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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: ```text 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.

CVE-2026-55254 Affected NCalc Versions

2 component(s)
Fixed Versions:
6.1.1
Product / Package Ecosystem Affected Versions Fixed Version
NCalc.Core
NuGet
< 6.1.1
6.1.1
NCalcSync
NuGet
< 6.1.1
6.1.1

References

Frequently Asked Questions

What is CVE-2026-55254?
CVE-2026-55254 is a security vulnerability in NCalc involving Denial of Service via Unbounded and Non-Terminating Factorial Evaluation under CWE-190: Integer Overflow or Wraparound.
Which NCalc versions are affected?
Affected versions include releases prior to 6.1.1 across affected packages: NCalc.Core, NCalcSync.
What version fixes CVE-2026-55254?
Upgrading to 6.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is NCalc.Core affected?
Yes, NCalc.Core is affected in releases prior to 6.1.1. Upgrade your dependency to 6.1.1 or later.
Is NCalcSync affected?
Yes, NCalcSync is affected in releases prior to 6.1.1. Upgrade your dependency to 6.1.1 or later.
What is the CVSS score of CVE-2026-55254?
CVE-2026-55254 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-55254?
CVE-2026-55254 is classified under CWE-190: Integer Overflow or Wraparound (The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.).
How can I check NuGet dependencies for CVE-2026-55254?
Run the dependency tree command: 'inspect dependencies for NCalc.Core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3w5p-95mh-gq75",
  "modified" : "2026-06-18T13:05:37Z",
  "published" : "2026-06-18T13:05:37Z",
  "aliases" : [ "CVE-2026-55254" ],
  "summary" : "NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation",
  "details" : "### Impact\n\nA 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.\n\nApplications that evaluate untrusted expressions using affected versions of NCalc may be vulnerable to resource exhaustion, potentially resulting in service disruption or application unresponsiveness.\n\nThis issue can be triggered with expressions such as:\n\n```text\n99999999999999!\n9223372036854775807!\n1.5e16!\n```\n\n### Patches\n\nThe vulnerability has been fixed by adding bounds validation for factorial operands and rejecting unsupported values before evaluation.\n\nUsers should upgrade to the first release containing the fix from pull request #575. (**v6.1.1+**)\n\n### Workarounds\n\nIf upgrading is not immediately possible:\n\n* Do not evaluate expressions originating from untrusted users.\n* Validate or sanitize expressions before evaluation and reject factorial operations on large values.\n* Implement execution time limits, request timeouts, or cancellation mechanisms around expression evaluation.\n\nThese mitigations may reduce exposure but do not fully address the underlying vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NCalc.Core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "NCalcSync"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ncalc/ncalc/security/advisories/GHSA-3w5p-95mh-gq75"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ncalc/ncalc/pull/575"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ncalc/ncalc"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-190", "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-18T13:05:37Z",
    "nvd_published_at" : null
  }
}