CVE-2025-2099Huggingface Transformers
High 7.5 No auth needed
Follow: this CVE · Huggingface · Huggingface Transformers We alert you by email or Slack (account required).
- Priority
- 60
- CVSS 3.1
- 7.5
- EPSS
- —
- Auth required
- No
- Published
- May 19, 2025
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-1333
- SSVC (CISA)
- Exploitation: proof of concept · Automatable: yes · Technical impact: partial
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
What happens
A vulnerability in the `preprocess_string()` function of the `transformers.testing_utils` module in huggingface/transformers version v4.48.3 allows for a Regular Expression Denial of Service (ReDoS) attack. The regular expression used to process code blocks in docstrings contains nested quantifiers, leading to exponential backtracking when processing input with a large number of newline characters. An attacker can exploit this by providing a specially crafted payload, causing high CPU usage and potential application downtime, effectively resulting in a Denial of Service (DoS) scenario.
What to do
- Apply the vendor's security update for Transformers.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| PyPI | transformers |
< 4.50.0 |
4.50.0 |
pip install "transformers>=4.50.0" |
| PyPI | transformers |
< 4.49.0 |
4.49.0 |
pip install "transformers>=4.49.0" |
Per OSV / GitHub Advisories (GHSA-qq3j-4f4f-9583, PYSEC-2025-40). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| huggingface | transformers | ≤ 4.48.3 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch
- huntr.com Exploit Third Party Advisory