ghsa-qq3j-4f4f-9583
Vulnerability from github
Published
2025-05-19 12:30
Modified
2025-09-25 21:06
Severity ?
Summary
Hugging Face Transformers Regular Expression Denial of Service
Details
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
{ "affected": [ { "package": { "ecosystem": "PyPI", "name": "transformers" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "4.50.0" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2025-2099" ], "database_specific": { "cwe_ids": [ "CWE-1333" ], "github_reviewed": true, "github_reviewed_at": "2025-05-19T21:53:36Z", "nvd_published_at": "2025-05-19T12:15:19Z", "severity": "MODERATE" }, "details": "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.\n\n**Fix:** released in **4.50.0**, which rewrites the regex to avoid the inefficient pattern. ([GitHub][1])\n\n* **Affected:** `\u003c 4.50.0`\n* **Patched:** `4.50.0`", "id": "GHSA-qq3j-4f4f-9583", "modified": "2025-09-25T21:06:38Z", "published": "2025-05-19T12:30:33Z", "references": [ { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-2099" }, { "type": "WEB", "url": "https://github.com/huggingface/transformers/pull/36648" }, { "type": "WEB", "url": "https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57" }, { "type": "PACKAGE", "url": "https://github.com/huggingface/transformers" }, { "type": "WEB", "url": "https://github.com/pypa/advisory-database/tree/main/vulns/transformers/PYSEC-2025-40.yaml" }, { "type": "WEB", "url": "https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "type": "CVSS_V3" } ], "summary": "Hugging Face Transformers Regular Expression Denial of Service" }
Loading...
Loading...
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.