Skip to main content
← All vulnerabilities
CVE-2025-5197PYSEC-2026-1983GHSA-9356-575X-2W9M

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

A Regular Expression Denial of Service (ReDoS) vulnerability exists in the Hugging Face Transformers library, specifically in the `convert_tf_weight_name_to_pt_weight_name()` function. This function, responsible for converting TensorFlow weight names to PyTorch format, uses a regex pattern `/[^/]*___([^/]*)/` that can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. The vulnerability affects versions up to 4.51.3 and is fixed in version 4.53.0. This issue can lead to service disruption, resource exhaustion, and potential API service vulnerabilities, impacting model conversion processes between TensorFlow and PyTorch formats.

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