Skip to main content

Inefficient Regular Expression Complexity

CVE-2025-3264

Severity Medium
Score 5.3/10

Summary

A Regular Expression Denial Of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically in the "get_imports()" function within "dynamic_module_utils.py". This vulnerability affects versions from 4.27.0 prior to v4.51.0. The issue arises from a regular expression pattern "\s*try\s*:.*?except.*?:" used to filter out "try/except" blocks from Python code, which can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. This vulnerability can lead to remote code loading disruption, resource exhaustion in model serving, supply chain attack vectors, and development pipeline disruption.

  • LOW
  • NETWORK
  • NONE
  • UNCHANGED
  • NONE
  • NONE
  • NONE
  • LOW

CWE-1333 - Inefficient Regular Expression Complexity

The product uses a regular expression with an inefficient, possibly exponential worst-case computational complexity that consumes excessive CPU cycles.

Advisory Timeline

  • Published