{"id":"CVE-2025-2099","published":"2025-05-19T11:22:36Z","modified":"2025-05-19T13:45:13Z","title":"Regular Expression Denial of Service (ReDoS) in huggingface/transformers","vendor":"huggingface","product":"huggingface/transformers","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00613,"percentile":0.50299,"provenance":"source"},"cwes":[{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity"}],"references":[{"url":"https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4","tags":[]},{"url":"https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57","tags":[]}],"priority":{"score":13.8,"factors":[{"name":"EPSS percentile","points":10.06},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"huggingface","affectedVersions":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[">= unspecified, < 4.50.0"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-05-19T13:38:03.242262Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"transformers","vulnerableRanges":["<4.50.0","<4.49.0"],"patched":["4.50.0","4.49.0"],"from":["GHSA-qq3j-4f4f-9583","PYSEC-2025-40"],"provenance":"source"}],"summary":{"text":"A regular expression in the preprocess_string() function of the transformers.testing_utils module in huggingface/transformers, used to process code blocks in docstrings, contains nested quantifiers that cause catastrophic backtracking. An attacker with network access and no authentication or user interaction can send a specially crafted input containing many newline characters to drive up CPU usage and disrupt the application.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:43:34Z"},"euvd":{"id":"EUVD-2025-15691","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-11394","published":"2024-11-22","fixed":"4.48.0","kev":false},{"cve":"CVE-2024-12720","published":"2025-03-20","fixed":"4.48.0","kev":false},{"cve":"CVE-2025-1194","published":"2025-04-29","fixed":"4.50.0","kev":false},{"cve":"CVE-2025-2099","published":"2025-05-19","fixed":"4.50.0","kev":false},{"cve":"CVE-2025-3262","published":"2025-07-07","fixed":"4.51.0","kev":false,"link":{"from":"CVE-2025-2099","to":"CVE-2025-3262","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:transformers","fromFixed":"4.50.0","toFixed":"4.51.0","daysApart":49}]}},{"cve":"CVE-2025-3263","published":"2025-07-07","fixed":"4.51.0","kev":false,"link":{"from":"CVE-2025-2099","to":"CVE-2025-3263","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:transformers","fromFixed":"4.50.0","toFixed":"4.51.0","daysApart":49}]}},{"cve":"CVE-2025-3264","published":"2025-07-07","fixed":"4.51.0","kev":false,"link":{"from":"CVE-2025-2099","to":"CVE-2025-3264","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:transformers","fromFixed":"4.50.0","toFixed":"4.51.0","daysApart":49}]}}],"package":"PyPI:transformers"}}