Skip to main content
← All vulnerabilities
CVE-2025-6921PYSEC-2026-1980GHSA-4W7R-H757-3R74

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

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

Summary

The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer. The vulnerability arises from the _do_use_weight_decay method, which processes user-controlled regular expressions in the include_in_weight_decay and exclude_from_weight_decay lists. Malicious regular expressions can cause catastrophic backtracking during the re.search call, leading to 100% CPU utilization and a denial of service. This issue can be exploited by attackers who can control the patterns in these lists, potentially causing the machine learning task to hang and rendering services unresponsive.

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.53.0

  • transformersPyPI

    fixed in 4.53.0

References 2

huntr.com

GitHub · huggingface/transformers