Skip to content
Heist/ feed
Back to feed
Medium

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-55254
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 04:41 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 17 Jul 2026, 19:55 UTC

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.

osv:CVE-2026-55254
Complete source record
{
  "id": "95d847d0c03a308cd5a868ee1f22da07243a760f3978a01c782f078c496283a8",
  "url": "https://osv.dev/vulnerability/CVE-2026-55254",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "NCalc: Denial of Service via Unbounded and Non-Terminating Factorial Evaluation",
    "summary": "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.",
    "evidence": "osv:CVE-2026-55254",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-55254",
      "aliases": [
        "CVE-2026-55254",
        "GHSA-3w5p-95mh-gq75"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:A/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/ncalc/ncalc",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "e885002a859c72eaf00b16a92d239960d289742f"
                },
                {
                  "fixed": "eeb6155ee1899b1fdf2cda3da35a4f0ca93ffd6a"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:ncalc:ncalc:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "6.1.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "eeb6155ee1899b1fdf2cda3da35a4f0ca93ffd6a"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "e885002a859c72eaf00b16a92d239960d289742f"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v6.1.1"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v5.10.0",
            "v5.2.5",
            "v5.2.3",
            "5.2.1",
            "v4.2.0",
            "v4.0.0",
            "v3.13.1",
            "v2.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-55254.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:33.271316214Z",
      "provider": "osv",
      "references": [
        "https://github.com/ncalc/ncalc/releases/tag/v6.1.1",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/55xxx/CVE-2026-55254.json",
        "https://github.com/ncalc/ncalc/security/advisories/GHSA-3w5p-95mh-gq75",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-55254",
        "https://github.com/ncalc/ncalc/commit/eeb6155ee1899b1fdf2cda3da35a4f0ca93ffd6a",
        "https://github.com/ncalc/ncalc/pull/575"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-190",
          "CWE-770"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/55xxx/CVE-2026-55254.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-55254",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 500352,
  "published_at": "2026-07-17T19:55:16.728+00:00"
}