CVE-2025-2099 json
Regular Expression Denial of Service (ReDoS) in huggingface/transformers
published 2025-05-19 17 mo ago modified 2026-06-17 4 mo ago also GHSA-qq3j-4f4f-9583 , PYSEC-2025-40 , EUVD-2025-15691
- cvss
- 5.3
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.6%
- EPSS 0.6% chance of exploitation in 30 days, percentile 49%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi transformers 4.49.0, 4.50.0
- huggingface huggingface/transformers 4.50.0
- github.com/huggingface/transformers@8cb522b commit
- github.com/huggingface/transformers#36648 pull request
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-2099 updated cvss 7.5
transformers: Regular Expression Denial of Service (ReDoS) in huggingface/transformers
-
Red Hat Enterprise Linux AI (RHEL AI) rhelai1/ui-rhel9, rhelai1/bootc-intel-rhel9, rhelai1/docling-serve-rhel9, rhelai1/instructlab-intel-rhel9affected: workaround, no fix available, no fix planned “Will not fix”
-
Red Hat Ansible Automation Platform 2.5 for RHEL 8 ansible-automation-platform-25/lightspeed-chatbot-rhel8 2.5.250730-2fixed: vendor fix RHSA-2025:12791
-
Red Hat OpenShift Lightspeed openshift-lightspeed-tech-preview/lightspeed-service-api-rhel9 Red Hat Ansible Automation Platform 2 ansible-automation-platform-24/de-minimal-rhel8, ansible-automation-platform-24/de-minimal-rhel9, ansible-automation-platform-25/de-minimal-rhel8, ansible-automation-platform-25/de-minimal-rhel9 Red Hat Ansible Automation Platform 2.5 for RHEL 8 ansible-automation-platform-25/hub-rhel8 4.10.6-3, ansible-automation-platform-25/hub-web-rhel8 4.10.6-3, ansible-automation-platform-25/receptor-rhel8 1.5.7-4, ansible-automation-platform-25/de-minimal-rhel8 1.1.7-6, ansible-automation-platform-25/controller-rhel8 4.6.18-1, ansible-automation-platform-25/de-supported-rhel8 1.1.7-5, +26 more Red Hat Ansible Automation Platform 2.5 for RHEL 9 ansible-automation-platform-25/de-minimal-rhel9 1.1.7-7, ansible-automation-platform-25/de-supported-rhel9 1.1.7-6, ansible-automation-platform-25/ee-minimal-rhel9 1.0.0-945, ansible-automation-platform-25/ee-supported-rhel9 1.0.0-1063, ansible-automation-platform-25/ansible-builder-rhel9 3.1.0-249, ansible-automation-platform-25/ee-cloud-services-rhel9 1.0.0-312, +2 more Red Hat Enterprise Linux AI (RHEL AI) rhelai1/bootc-amd-rhel9, rhelai1/bootc-nvidia-rhel9, rhelai1/bootc-azure-amd-rhel9, rhelai1/instructlab-amd-rhel9, rhelai1/bootc-aws-nvidia-rhel9, rhelai1/bootc-gcp-nvidia-rhel9, +2 more Red Hat OpenShift AI (RHOAI) rhoai/odh-training-operator-rhel8not affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 17 mo ago
Exploit prediction
0.60% chance of exploitation in the next 30 days, higher than 49% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- huntr.com https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| NVD | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 3.0 | 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| OSV | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | transformers | <4.50.0 <4.49.0 |
4.50.0 4.49.0 |
Affected products
- huggingface huggingface/transformers
Classification
- Weakness
-
- CWE-1333 Inefficient Regular Expression Complexity
References
-
github.com
/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57
web, patch
-
github.com
/huggingface/transformers/pull/36648
web
-
huntr.com
/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4
web, exploit, third-party-advisory, evidence
-
nvd.nist.gov
/vuln/detail/CVE-2025-2099
advisory
-
github.com
/huggingface/transformers
package
-
github.com
/pypa/advisory-database/tree/main/vulns/transformers/PYSEC-2025-40.yaml
web
-
github.com
/advisories/GHSA-qq3j-4f4f-9583
advisory
Sources
- CVE List CVE-2025-2099
- GitHub Advisory GHSA-qq3j-4f4f-9583
- NVD CVE-2025-2099
- OSV PYSEC-2025-40
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.