Read the docs
TI-2025-06294 Aliases CVE-2025-6921GHSA-4w7r-h757-3r74

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

Priority HIGH 72CWE-400Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · High
Fix status
Partial Red Hat: 5 without a fix

Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-400.

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00511 43rd percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Partial huggingface/transformers (huggingface): 4.53.0transformers (PyPI): 4.53.0Red Hat: 5 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
Yes
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
huggingfacehuggingface/transformersbefore 4.53.04.53.0Patch availableCNA
—transformers (PyPI)before 4.53.04.53.0Patch availableGHSA-4w7r-h757-3r74
  • huggingface/transformers Vendorhuggingface Affected before 4.53.0 Fixed in 4.53.0 Patch available CNA
  • transformers (PyPI) Vendor— Affected before 4.53.0 Fixed in 4.53.0 Patch available GHSA-4w7r-h757-3r74

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:*before 4.53.0Vulnerablehuggingface
  • cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:* Versions before 4.53.0 Vulnerable ·huggingface

Remediation

  • Fix · CNA huggingface/transformers (huggingface) Fixed in 4.53.0
  • Fix · GHSA-4w7r-h757-3r74 transformers (PyPI) Fixed in 4.53.0 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Moderate. Red Hat's page for this CVE →

ProductStatusPlan or fix
OpenShift LightspeedAffectedNo fix yet: Fix deferred
Red Hat AI Inference ServerAffectedNo fix yet: Fix deferred
Red Hat Ansible Automation Platform 2AffectedNo fix yet: Fix deferred
Red Hat Enterprise Linux AI (RHEL AI)AffectedNo fix yet: Fix deferred
Red Hat OpenShift AI (RHOAI)AffectedNo fix yet: Fix deferred

Timeline

  1. 2026-10-02 Threatist record created from CVE-2025-6921
  2. 2026-10-03 Alias added: GHSA-4w7r-h757-3r74

References

  • TI-2026-04577 Policy Bypass in LightGlue Nested Config Resolution in huggingface/transformers CVSS 3.1CRITICAL 9.6
  • TI-2025-06027 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
  • TI-2025-02858 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
  • TI-2025-01837 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
  • TI-2024-11793 Regular Expression Denial of Service (ReDoS) in huggingface/transformers CVSS 3.1HIGH 7.5
  • TI-2026-01514 Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers CVSS 3.1HIGH 7.8
See all 29 →

Sources