Skip to main content
CVE-2025-3264VulnerabilityPublished

CVE-2025-3264: huggingface/transformers · ReDoS

Affects huggingface/transformersSource CVE Database V5

0

Not known to be exploited · CVSS 5.3 Medium : upgrade to 4.51.0 when convenient.

Data as of 25 Oct 2026, 19:02 UTC

CVSS 3.0 base score
5.3Medium
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.4% chance of exploitation in 30 days – higher than 42% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
Patch
Available – fixed in 4.51.0
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 7 Jul 2025

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-25.

What to do

Upgrade transformers to 4.51.0.

Affected software

ProductAffectedFixed in
PyPItransformerspkg:pypi/transformersOther threatsAffected
  • >=4.49.0 <4.51.0
Fixed in
  • 4.51.0

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

European organizations should prioritize upgrading the Hugging Face Transformers library to version 4.51.0 or later, where the vulnerability is fixed. In environments where immediate upgrade is not feasible, organizations can implement input validation and sanitization to detect and block suspiciously complex or malformed inputs that could trigger the ReDoS condition. Monitoring CPU and memory usage patterns in AI model serving infrastructure can help detect anomalous resource consumption indicative of exploitation attempts. Incorporating rate limiting and request throttling mechanisms on endpoints that process user-supplied code or model inputs can reduce the risk of resource exhaustion. Additionally, organizations should review and harden their development pipelines to ensure that untrusted or external code is not processed without adequate scrutiny. Employing static analysis tools to detect inefficient regular expressions and potential ReDoS patterns in custom code can prevent similar vulnerabilities. Finally, maintaining an up-to-date inventory of AI/ML dependencies and integrating vulnerability scanning into CI/CD workflows will help promptly identify and remediate such issues.

Description

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 4.49.0 and is fixed in version 4.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.

References

Community reviews

Loading reviews…