The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-2099

CVE-2025-2099: Huggingface Transformers ReDoS Vulnerability

CVE-2025-2099 is a Regular Expression Denial of Service flaw in Huggingface Transformers that allows attackers to cause high CPU usage and application downtime. This article covers the technical details, affected versions, and mitigation.

Updated: January 22, 2026

CVE-2025-2099 Overview

A Regular Expression Denial of Service (ReDoS) vulnerability exists in the preprocess_string() function within the transformers.testing_utils module of Huggingface Transformers version v4.48.3. The vulnerability stems from a poorly constructed regular expression containing nested quantifiers that processes code blocks in docstrings. When an attacker provides input containing a large number of newline characters, the regex engine experiences exponential backtracking, leading to excessive CPU consumption and potential application downtime.

Critical Impact

Attackers can exploit this vulnerability to cause Denial of Service conditions by sending specially crafted payloads that trigger exponential regex backtracking, resulting in high CPU usage and application unavailability.

Affected Products

  • Huggingface Transformers v4.48.3
  • Huggingface Transformers (versions prior to the security patch)

Discovery Timeline

  • 2025-05-19 - CVE-2025-2099 published to NVD
  • 2025-05-21 - Last updated in NVD database

Technical Details for CVE-2025-2099

Vulnerability Analysis

This vulnerability is classified under CWE-1333 (Inefficient Regular Expression Complexity). The core issue resides in the preprocess_string() function, which is responsible for parsing and processing docstrings containing code blocks. The function employs a regular expression pattern with nested quantifiers—a known antipattern that can lead to catastrophic backtracking scenarios.

When processing input strings, the regex engine attempts to match patterns in multiple ways. With nested quantifiers, the number of possible matching combinations grows exponentially with input length. This algorithmic complexity attack allows a remote attacker to craft payloads that force the regex engine into an extremely long processing loop, effectively consuming all available CPU resources.

The attack is particularly concerning because it can be triggered remotely without authentication, requires low complexity to execute, and directly impacts system availability.

Root Cause

The root cause is the use of a regular expression containing nested quantifiers within the preprocess_string() function. Nested quantifiers (such as (a+)+ or similar patterns) create ambiguous matching scenarios where the regex engine must explore an exponentially growing number of backtracking paths to determine if a match exists. When input contains sequences of characters that partially match the pattern—particularly strings with many newline characters in this case—the backtracking behavior becomes computationally expensive.

Attack Vector

The attack vector is network-based, allowing remote exploitation without requiring authentication or user interaction. An attacker can submit a malicious payload containing a carefully crafted string with numerous newline characters to any application endpoint that processes docstrings using the vulnerable preprocess_string() function. The attack does not compromise data confidentiality or integrity but directly impacts availability by exhausting CPU resources.

The exploitation mechanism works as follows: the attacker constructs a payload specifically designed to maximize regex backtracking. When the vulnerable function attempts to process this payload, the regex engine enters an extended computation loop, potentially lasting minutes or hours depending on payload size. During this time, the affected thread or process is unable to handle legitimate requests, resulting in denial of service.

Detection Methods for CVE-2025-2099

Indicators of Compromise

  • Abnormally high CPU utilization on systems running Huggingface Transformers applications
  • Application threads or processes becoming unresponsive during docstring processing operations
  • Incoming requests containing unusually large numbers of newline characters
  • System logs showing timeout errors or resource exhaustion warnings in transformers.testing_utils module

Detection Strategies

  • Monitor CPU utilization patterns for sustained spikes coinciding with incoming requests to Transformers-based applications
  • Implement application-level logging to track execution time of preprocess_string() function calls
  • Deploy Web Application Firewall (WAF) rules to detect and block requests with abnormally high newline character counts
  • Utilize behavioral analysis to identify request patterns that deviate from normal docstring processing workloads

Monitoring Recommendations

  • Set up alerting thresholds for CPU usage anomalies on servers running Huggingface Transformers
  • Enable detailed request logging to capture and analyze payloads that trigger extended processing times
  • Monitor application response times and establish baselines to quickly identify degradation
  • Implement rate limiting on endpoints that process user-supplied docstrings or code blocks

How to Mitigate CVE-2025-2099

Immediate Actions Required

  • Update Huggingface Transformers to the latest patched version immediately
  • Review application code to identify any direct usage of the preprocess_string() function with user-controlled input
  • Implement input validation to limit the size and character composition of strings passed to docstring processing functions
  • Consider implementing request timeouts to prevent long-running regex operations from consuming resources indefinitely

Patch Information

Huggingface has released a security patch to address this vulnerability. The fix is available in commit 8cb522b4190bd556ce51be04942720650b1a3e57. Organizations using Huggingface Transformers should update to the patched version as soon as possible. The patch can be reviewed at the Huggingface Transformers GitHub repository.

Additional details about the vulnerability discovery and disclosure are available through the Huntr bounty listing.

Workarounds

  • Implement input sanitization to strip or limit excessive newline characters before passing strings to the vulnerable function
  • Add execution timeouts around calls to preprocess_string() to prevent runaway CPU consumption
  • Deploy rate limiting on API endpoints that process docstrings to reduce the impact of attempted exploitation
  • Consider temporarily disabling or restricting access to features that rely on docstring preprocessing until the patch can be applied
bash
# Update Huggingface Transformers to the latest version
pip install --upgrade transformers

# Verify the installed version
pip show transformers | grep Version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechHuggingface Transformers

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.11%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-1333
  • Technical References
  • Huntr Bounty Listing
  • Vendor Resources
  • GitHub Commit Update
  • Related CVEs
  • CVE-2024-11392: Huggingface Transformers RCE Vulnerability

  • CVE-2024-11393: Hugging Face Transformers RCE Vulnerability

  • CVE-2024-11394: Hugging Face Transformers RCE Vulnerability

  • CVE-2023-7018: Huggingface Transformers Deserialization Flaw
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English