Skip to content
Heist/ feed
Back to feed
Medium

Regular Expression Denial of Service (ReDoS) in huggingface/transformers

Type: advisorySources: OSV

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the `normalize_numbers()` method of the `EnglishNormalizer` class. This vulnerability affects versions up to 4.52.4 and is fixed in version 4.53.0. The issue arises from the method's handling of numeric strings, which can be exploited using crafted input strings containing long sequences of digits, leading to excessive CPU consumption. This vulnerability impacts text-to-speech and number normalization tasks, potentially causing service disruption, resource exhaustion, and API vulnerabilities.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2025-6051
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 19:08 UTC · Revision 1

Source evidence

Regular Expression Denial of Service (ReDoS) in huggingface/transformers

core-osv · Original source

Published 14 Sept 2025, 17:03 UTC

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the `normalize_numbers()` method of the `EnglishNormalizer` class. This vulnerability affects versions up to 4.52.4 and is fixed in version 4.53.0. The issue arises from the method's handling of numeric strings, which can be exploited using crafted input strings containing long sequences of digits, leading to excessive CPU consumption. This vulnerability impacts text-to-speech and number normalization tasks, potentially causing service disruption, resource exhaustion, and API vulnerabilities.

osv:CVE-2025-6051
Complete source record
{
  "id": "0e5c99ddd963a57117ba350e91515d2afc04122d17a4d4955ac7554d188caf07",
  "url": "https://osv.dev/vulnerability/CVE-2025-6051",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Regular Expression Denial of Service (ReDoS) in huggingface/transformers",
    "summary": "A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the `normalize_numbers()` method of the `EnglishNormalizer` class. This vulnerability affects versions up to 4.52.4 and is fixed in version 4.53.0. The issue arises from the method's handling of numeric strings, which can be exploited using crafted input strings containing long sequences of digits, leading to excessive CPU consumption. This vulnerability impacts text-to-speech and number normalization tasks, potentially causing service disruption, resource exhaustion, and API vulnerabilities.",
    "evidence": "osv:CVE-2025-6051",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2025-6051",
      "aliases": [
        "CVE-2025-6051",
        "GHSA-rcv9-qm8p-9p6j",
        "PYSEC-2026-1988"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/huggingface/transformers",
              "type": "GIT",
              "events": [
                {
                  "introduced": "51f94ea06d19a6308c61bbb4dc97c40aabd12bad"
                },
                {
                  "fixed": "ba8eaba9865618253f997784aa565b96206426f0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:huggingface:transformers:4.52.4:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "4.52.4"
                      },
                      {
                        "last_affected": "4.52.4"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "range": [
                      {
                        "fixed": "ba8eaba9865618253f997784aa565b96206426f0"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "4.52.4"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-6051.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:22.622541068Z",
      "provider": "osv",
      "references": [
        "https://huntr.com/bounties/af929523-7b59-418a-bf55-301830b2ac9d",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/6xxx/CVE-2025-6051.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-6051",
        "https://github.com/huggingface/transformers/commit/ba8eaba9865618253f997784aa565b96206426f0"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-1333"
        ],
        "cna_assigner": "@huntr_ai",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/6xxx/CVE-2025-6051.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-6051",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 488977,
  "published_at": "2025-09-14T17:03:02.953+00:00"
}