Vulnerabilities in pkg:nuget/NCalc.Core
PACKAGECVE-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.
pkg:nuget/NCalc.Core
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
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).
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.
Upgrade NCalc.Core to 6.1.1
Upgrade NCalcSync to 6.1.1
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
CVE-2026-55254 Affected NCalc Versions
2 component(s)| 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?
Which NCalc versions are affected?
What version fixes CVE-2026-55254?
Is NCalc.Core affected?
Is NCalcSync affected?
What is the CVSS score of CVE-2026-55254?
What CWE is associated with CVE-2026-55254?
How can I check NuGet dependencies for CVE-2026-55254?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}