{"cve":"CVE-2025-2099","nvd":{"published":"2025-05-19T12:15:19.640","modified":"2026-06-17T09:06:19.567","status":"Analyzed","description":"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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5},"cwes":["CWE-1333"],"references":["https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57","https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4"],"products":["huggingface:transformers"],"source":"nvd","synced_at":"2026-10-19T22:01:57.636215869+00:00"},"epss":{"cve":"CVE-2025-2099","score":0.00608,"percentile":0.49076,"date":"2026-11-01"},"kev":null,"osv":[{"id":"GHSA-qq3j-4f4f-9583","url":"https://osv.dev/vulnerability/GHSA-qq3j-4f4f-9583","summary":"Hugging Face Transformers Regular Expression Denial of Service","modified":"2025-09-25T21:51:20.118086Z","packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":["<4.50.0"],"fixed":["4.50.0"]}]},{"id":"PYSEC-2025-40","url":"https://osv.dev/vulnerability/PYSEC-2025-40","summary":"","modified":"2026-06-10T17:02:48.111891265Z","packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":["<4.49.0"],"fixed":["4.49.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}