Skip to main content
← All vulnerabilities
CVE-2025-2099PYSEC-2025-40GHSA-QQ3J-4F4F-9583

Regular Expression Denial of Service (ReDoS) in huggingface/transformers

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 4.50.0, 4.49.0
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: poc
  • Automatable: yes
  • Technical impact: partial

Summary

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.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: poc · Automatable: yes · Technical impact: partial

  3. Record last updated

Affected versions

  • huggingface huggingface/transformers

    fixed in 4.50.0

  • transformersPyPI

    fixed in 4.49.0

  • transformersPyPI

    fixed in 4.50.0

References 2

huntr.com

GitHub · huggingface/transformers