Skip to content
Submit incident
AII-1001-95187
ConfirmedA court, a regulator or the organization itself has stated the core facts, or the record cites a court or regulator source.Supporting sources are pending verification.

ReDoS vulnerability in huggingface/transformers regex

A Regular Expression Denial of Service (ReDoS) vulnerability was found in the documentation preprocessing regex of huggingface/transformers. The vulnerable pattern was patched with a simplified regex that avoids the catastrophic backtracking issue.

19 May 2025 Β· Hugging Face Β· Security and cyberattacks
19 May 2025
AII-1001-95187
Quick facts
Category
Security and cyberattacks
Date
19 May 2025
Drafted by
Raidu Incident Detection

What happened

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the regex pattern used for preprocessing documentation in huggingface/transformers. The vulnerable regex pattern was: r"(```(?:python|py)\s*\n\s*>>> )( (?:.*?\n)*? .*?```)". The vulnerability was fixed by simplifying the regex pattern to r"(```(?:python|py)\s*\n\s*>>> )(.*?```)".

Classification

Category
Security and cyberattacks
Harm status
Potential harm
Intent
Unintentional
Timing
Unknown
Consequences
None recorded
AI systems
transformers

Sources and evidence

Sources not yet published

This record was researched and written by the Index from original reporting. Its sources are still being verified by an editor, and they are listed here once that check is complete. Until then the record carries no reviewer.

How sources are verifiedSuggest a source for this incident