Ameeba Exploit Tracker

Tracking CVEs, exploits, and zero-days for defensive cybersecurity research.

Ameeba Blog Search
TRENDING · 1 WEEK
Attack Vector
Vendor
Severity

CVE-2025-2099: Regular Expression Denial of Service (ReDoS) Attack on huggingface/transformers

Ameeba Chat Store screens
Download Ameeba Chat

Overview

A critical vulnerability, identified as CVE-2025-2099, has been discovered in the `transformers.testing_utils` module of huggingface/transformers, a popular machine learning library. This vulnerability, specifically within the `preprocess_string()` function, potentially exposes systems to Regular Expression Denial of Service (ReDoS) attacks. It is significant as it can lead to high system CPU usage, resulting in potential application downtime and posing a risk to system stability and data security.

Vulnerability Summary

CVE ID: CVE-2025-2099
Severity: High (7.5 CVSS Score)
Attack Vector: Network
Privileges Required: None
User Interaction: None
Impact: Potential system compromise or data leakage

Affected Products

Ameeba Chat Icon Escape the Surveillance Era

Most apps won’t tell you the truth.
They’re part of the problem.

Phone numbers. Emails. Profiles. Logs.
It’s all fuel for surveillance.

Ameeba Chat gives you a way out.

  • • No phone number
  • • No email
  • • No personal info
  • • Anonymous aliases
  • • End-to-end encrypted

Chat without a trace.

Product | Affected Versions

huggingface/transformers | v4.48.3

How the Exploit Works

The vulnerability exists in the `preprocess_string()` function of the `transformers.testing_utils` module in huggingface/transformers. The regular expression used for processing code blocks in docstrings has nested quantifiers. This causes exponential backtracking when processing input with a large number of newline characters. An attacker can exploit this by providing a specially crafted payload, causing high CPU usage and potential application downtime. This effectively allows for a Denial of Service (DoS) scenario.

Conceptual Example Code

The following pseudocode example demonstrates how an attacker might exploit this vulnerability:

import transformers.testing_utils as utils
malicious_payload = "\n" * 100000  # A long string of newline characters
utils.preprocess_string(malicious_payload)

In this conceptual example, the `malicious_payload` string consists of a large number of newline characters. When passed to the `preprocess_string()` function, it triggers the vulnerability, leading to high CPU usage and potential denial of service.

Want to discuss this further? Join the Ameeba Cybersecurity Group Chat.

Disclaimer:

The information and code presented in this article are provided for educational and defensive cybersecurity purposes only. Any conceptual or pseudocode examples are simplified representations intended to raise awareness and promote secure development and system configuration practices.

Do not use this information to attempt unauthorized access or exploit vulnerabilities on systems that you do not own or have explicit permission to test.

Ameeba and its authors do not endorse or condone malicious behavior and are not responsible for misuse of the content. Always follow ethical hacking guidelines, responsible disclosure practices, and local laws.
Ameeba Chat