{"id":"CVE-2025-2099","state":"PUBLISHED","title":"Regular Expression Denial of Service (ReDoS) in huggingface/transformers","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.","publishedAt":"2025-05-19T11:22:36.908Z","updatedAt":"2025-05-19T13:45:13.385Z","severity":{"score":5.3,"label":"Medium","version":"3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","source":"@huntr_ai"},"assigner":"@huntr_ai","products":["huggingface huggingface/transformers"],"affected":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[{"version":"unspecified","status":"affected","lessThan":"4.50.0","versionType":"custom"}]}],"references":["https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4","https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57"],"weaknesses":["CWE-1333"],"ingestedAt":"2026-10-29T20:08:55.257Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/2xxx/CVE-2025-2099.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2025-2099","state":"PUBLISHED","datePublished":"2025-05-19T11:22:36.908Z","dateUpdated":"2025-05-19T13:45:13.385Z","assignerShortName":"@huntr_ai","assignerOrgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateReserved":"2025-03-07T17:39:16.856Z"},"containers":{"cna":{"title":"Regular Expression Denial of Service (ReDoS) in huggingface/transformers","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[{"version":"unspecified","status":"affected","lessThan":"4.50.0","versionType":"custom"}]}],"references":[{"url":"https://huntr.com/bounties/97b780f3-ffca-424f-ad5d-0e1c57a5bde4"},{"url":"https://github.com/huggingface/transformers/commit/8cb522b4190bd556ce51be04942720650b1a3e57"}],"metrics":[{"cvssV3_0":{"version":"3.0","attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"LOW","confidentialityImpact":"NONE","integrityImpact":"NONE","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","baseScore":5.3,"baseSeverity":"MEDIUM"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-1333","type":"CWE","lang":"en","description":"CWE-1333 Inefficient Regular Expression Complexity"}]}],"providerMetadata":{"shortName":"@huntr_ai","orgId":"c09c270a-b464-47c1-9133-acb35b22c19a","dateUpdated":"2025-05-19T11:22:36.908Z"},"source":{"advisory":"97b780f3-ffca-424f-ad5d-0e1c57a5bde4","discovery":"EXTERNAL"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2025-05-19T13:38:03.242262Z","id":"CVE-2025-2099","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-05-19T13:45:13.385Z"}}]}}}