Regular Expression Denial of Service (ReDoS) in huggingface/transformers
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 6 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-1333.
Summary
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically affecting the MarianTokenizer's `remove_language_code()` method. This vulnerability is present in version 4.52.4 and has been fixed in version 4.53.0. The issue arises from inefficient regex processing, which can be exploited by crafted input strings containing malformed language code patterns, leading to excessive CPU consumption and potential denial of service.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| huggingface | huggingface/transformers | before 4.53.0 | 4.53.0 | Patch available | CNA |
| — | transformers (PyPI) | before 4.53.0 | 4.53.0 | Patch available | GHSA-59p9-h35m-wg4g |
- huggingface/transformers Vendorhuggingface Affected before 4.53.0 Fixed in 4.53.0 Patch available CNA
- transformers (PyPI) Vendor— Affected before 4.53.0 Fixed in 4.53.0 Patch available GHSA-59p9-h35m-wg4g
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:huggingface:transformers:4.52.4:*:*:*:*:*:*:* | 4.52.4 | Vulnerable | huggingface |
- cpe:2.3:a:huggingface:transformers:4.52.4:*:*:*:*:*:*:* Versions 4.52.4 Vulnerable ·huggingface
Remediation
- Fix · CNA huggingface/transformers (huggingface) Fixed in 4.53.0
- Fix · GHSA-59p9-h35m-wg4g transformers (PyPI) Fixed in 4.53.0 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Lightspeed | Affected | No fix yet |
| Red Hat AI Inference Server | Affected | No fix yet |
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet |
| Red Hat Enterprise Linux AI (RHEL AI) | Affected | No fix yet |
| Red Hat Enterprise Linux AI (RHEL AI) 3 | Affected | No fix yet |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet |
Timeline
- 2026-10-02 Threatist record created from CVE-2025-6638
- 2026-10-03 Alias added: GHSA-59p9-h35m-wg4g
References
More huggingface Transformers vulnerabilities
- TI-2026-04577 Policy Bypass in LightGlue Nested Config Resolution in huggingface/transformers CVSS 3.1CRITICAL 9.6
- TI-2025-06294 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
- TI-2025-02858 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
- TI-2025-01837 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
- TI-2024-11793 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
- TI-2026-01514 Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers CVSS 3.1HIGH 7.8
Sources
- CVE-2025-6638 · CVE Program
- CVE-2025-6638 · NVD
- FIRST EPSS
- GHSA-59p9-h35m-wg4g · GitHub Advisory Database · CC BY 4.0
- CVE-2025-6638 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences