CVE-2025-6051: Transformers: ReDoS in EnglishNormalizer exhausts CPU
GHSA-rcv9-qm8p-9p6j MEDIUM PoC AVAILABLE CISA: TRACK*Upgrade Hugging Face Transformers to 4.53.0 immediately if you run any TTS or text normalization pipelines that accept external input. This ReDoS is trivially exploitable with no authentication — a single crafted string of digits can peg a CPU core and degrade or kill your inference service. The EPSS score is near zero today, but the attack pattern is trivial enough that exploitation could spike once PoC details spread from the Huntr disclosure.
What is the risk?
Effective risk is moderate-to-high for externally-exposed inference APIs despite the CVSS 5.3 rating. The CVSS vector (AV:N/AC:L/PR:N/UI:N) means any unauthenticated remote attacker can trigger it. Impact is purely availability (no confidentiality or integrity loss), but in production AI deployments, a sustained CPU exhaustion attack can translate to SLA breaches, autoscaling cost spikes, and cascading failures in multi-model pipelines. Low EPSS (0.00034) reflects limited active exploitation today, but the vulnerability is in one of the most-deployed ML libraries globally.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Transformers | pip | — | No patch |
| Transformers | pip | < 4.53.0 | 4.53.0 |
How severe is it?
What is the attack surface?
What should I do?
5 steps-
PATCH
Upgrade transformers to >= 4.53.0 (pip install --upgrade transformers). Verify with pip show transformers.
-
WORKAROUND (if immediate patching is blocked): Add input validation upstream — reject or truncate strings exceeding a reasonable digit-run length (e.g., reject inputs with consecutive digit sequences > 50 chars).
-
DETECTION
Alert on CPU utilization spikes in inference workers correlated with text-processing requests; set process-level CPU limits (cgroups/K8s resource limits) to prevent one request from monopolizing the node.
-
INVENTORY
Audit all services importing transformers and identify which expose text input to the EnglishNormalizer code path.
-
VERIFY
Check the commit at ba8eaba9865618253f997784aa565b96206426f0 for the exact regex fix to understand the vulnerable pattern.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-6051?
Upgrade Hugging Face Transformers to 4.53.0 immediately if you run any TTS or text normalization pipelines that accept external input. This ReDoS is trivially exploitable with no authentication — a single crafted string of digits can peg a CPU core and degrade or kill your inference service. The EPSS score is near zero today, but the attack pattern is trivial enough that exploitation could spike once PoC details spread from the Huntr disclosure.
Is CVE-2025-6051 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-6051, increasing the risk of exploitation.
How to fix CVE-2025-6051?
1. PATCH: Upgrade transformers to >= 4.53.0 (pip install --upgrade transformers). Verify with pip show transformers. 2. WORKAROUND (if immediate patching is blocked): Add input validation upstream — reject or truncate strings exceeding a reasonable digit-run length (e.g., reject inputs with consecutive digit sequences > 50 chars). 3. DETECTION: Alert on CPU utilization spikes in inference workers correlated with text-processing requests; set process-level CPU limits (cgroups/K8s resource limits) to prevent one request from monopolizing the node. 4. INVENTORY: Audit all services importing transformers and identify which expose text input to the EnglishNormalizer code path. 5. VERIFY: Check the commit at ba8eaba9865618253f997784aa565b96206426f0 for the exact regex fix to understand the vulnerable pattern.
What systems are affected by CVE-2025-6051?
This vulnerability affects the following AI/ML architecture patterns: TTS inference pipelines, NLP text normalization services, model serving, batch enrichment pipelines, training data preprocessing.
What is the CVSS score for CVE-2025-6051?
CVE-2025-6051 has a CVSS v3.1 base score of 5.3 (MEDIUM). The EPSS exploitation probability is 0.35%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0029 Denial of AI Service AML.T0034 Cost Harvesting AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An adversary identifies a public-facing TTS or text-normalization API endpoint powered by Hugging Face Transformers (discoverable via response headers, error messages, or job listings). They craft a POST request with a body containing a long numeric string (e.g., a 50,000-digit number). The normalize_numbers() regex enters catastrophic backtracking, consuming 100% of a CPU core for tens of seconds per request. By sending a low-rate stream of such requests (avoiding traditional rate-limit thresholds), the attacker degrades service quality for all users. In a single-threaded or worker-pool model, this effectively takes the endpoint offline. No credentials, no prior access, no AI/ML knowledge required.
Weaknesses (CWE)
CWE-1333 Inefficient Regular Expression Complexity
Primary
CWE-1333 Inefficient Regular Expression Complexity CWE-1333 — Inefficient Regular Expression Complexity: The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
- [Architecture and Design] Use regular expressions that do not support backtracking, e.g. by removing nested quantifiers.
- [System Configuration] Set backtracking limits in the configuration of the regular expression implementation, such as PHP's pcre.backtrack_limit. Also consider limits on execution time for the process.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L References
- github.com/advisories/GHSA-rcv9-qm8p-9p6j
- github.com/huggingface/transformers/commit/54a02160eb030da9be18231c77791f2eb3a52216
- github.com/huggingface/transformers/pull/38844
- nvd.nist.gov/vuln/detail/CVE-2025-6051
- github.com/huggingface/transformers/commit/ba8eaba9865618253f997784aa565b96206426f0 Patch
- huntr.com/bounties/af929523-7b59-418a-bf55-301830b2ac9d Exploit Issue Patch 3rd Party
Timeline
Related Vulnerabilities
CVE-2026-26210 9.8 KTransformers: pickle RCE via unauthenticated ZMQ socket
Same package: transformers CVE-2024-3568 9.6 HuggingFace Transformers: RCE via pickle deserialization
Same package: transformers CVE-2026-5241 9.6 transformers: trust_remote_code bypass enables RCE via model load
Same package: transformers CVE-2023-6730 8.8 HuggingFace Transformers: RCE via unsafe deserialization
Same package: transformers CVE-2024-11392 8.8 HuggingFace Transformers: RCE via config deserialization
Same package: transformers