CVE-2025-2099
highpriority · track · 30EPSS 0.006 · 49 %ileDEEUUSEPSS · scored 2026-10-27
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 5.3–7.5
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (5)
Products and version ranges known to be affected.
- Red Hat Ansible Automation Platform 2.5all versionscert_bundDEcpe:/a:redhat:ansible_automation_platform:2.5
advisories (3)
Vendor and ecosystem advisories describing this.
- WID-SEC-W-2025-1707Red Hat Ansible Automation Platform: Schwachstelle ermöglicht Denial of ServiceDeutsch2025-08-04csaf · cert_bundDE
Ein entfernter, anonymer Angreifer kann eine Schwachstelle in Red Hat Ansible Automation Platform ausnutzen, um einen Denial of Service Angriff durchzuführen.
- GHSA-qq3j-4f4f-9583Hugging Face Transformers Regular Expression Denial of Service2025-05-19ghsa · osvUS
A Regular Expression Denial of Service (ReDoS) exists in the `preprocess_string()` function of the `transformers.testing_utils` module. In versions **before 4.50.0**, the regex used to process code blocks in docstrings contains nested quantifiers that can trigger catastrophic backtracking when given inputs with many newline characters. An attacker who can supply such input to `preprocess_string()` (or code paths that call it) can force excessive CPU usage and degrade availability. **Fix:** released in **4.50.0**, which rewrites the regex to avoid the inefficient pattern. ([GitHub][1]) * **Affected:** `< 4.50.0` * **Patched:** `4.50.0`
- PYSEC-2025-402025-05-19vendor · osvUS
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.
also known as (6)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (8)
External citations — patches, advisories, analysis.
- https://access.redhat.com/security/cve/cve-2025-2099cnnvd
- https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57cnnvd
- https://github.com/huggingface/transformers/releasesPatchcnnvd
- https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4cnnvd
- https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57enisa_euvd
- https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4enisa_euvd
- https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57Patchnvd
- https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4ExploitThird Party Advisorynvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan