Skip to main content

CVE-2025-3263: CWE-1333 Inefficient Regular Expression Complexity in huggingface huggingface/transformers

Medium
VulnerabilityCVE-2025-3263cvecve-2025-3263cwe-1333
Published: Mon Jul 07 2025 (07/07/2025, 09:54:59 UTC)
Source: CVE Database V5
Vendor/Project: huggingface
Product: huggingface/transformers

Description

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically in the `get_configuration_file()` function within the `transformers.configuration_utils` module. The affected version is 4.49.0, and the issue is resolved in version 4.51.0. The vulnerability arises from the use of a regular expression pattern `config\.(.*)\.json` that can be exploited to cause excessive CPU consumption through crafted input strings, leading to catastrophic backtracking. This can result in model serving disruption, resource exhaustion, and increased latency in applications using the library.

AI-Powered Analysis

AILast updated: 07/07/2025, 10:26:58 UTC

Technical Analysis

CVE-2025-3263 is a Regular Expression Denial of Service (ReDoS) vulnerability identified in the Hugging Face Transformers library, specifically within the get_configuration_file() function of the transformers.configuration_utils module. The vulnerability affects version 4.49.0 of the library and was resolved in version 4.51.0. The root cause is an inefficient regular expression pattern, config\.(.*)\.json, which is susceptible to catastrophic backtracking when processing specially crafted input strings. This leads to excessive CPU consumption, causing significant delays or complete denial of service in applications that rely on this function for loading configuration files. Since Hugging Face Transformers is widely used for natural language processing (NLP) and machine learning model serving, exploitation of this vulnerability can disrupt model availability and degrade application performance. The CVSS score of 5.3 (medium severity) reflects that the vulnerability can be exploited remotely without authentication or user interaction, impacting availability but not confidentiality or integrity. No known exploits are reported in the wild as of now. The vulnerability is classified under CWE-1333, which pertains to inefficient regular expression complexity leading to resource exhaustion. The issue highlights the importance of carefully designing regular expressions in security-critical code to avoid performance pitfalls that can be weaponized for denial of service attacks.

Potential Impact

For European organizations using the Hugging Face Transformers library, especially those deploying NLP models in production environments, this vulnerability poses a risk of service disruption. Applications that load configuration files using the affected function may experience increased latency or become unresponsive under attack, leading to denial of service. This can affect customer-facing services, internal automation, or research workflows relying on timely model inference. Resource exhaustion caused by the ReDoS attack could also increase operational costs due to higher CPU usage and potentially trigger cascading failures in distributed systems. Sectors such as finance, healthcare, and government, which increasingly adopt AI/ML technologies for decision-making and automation, may face operational risks and reputational damage if availability is compromised. However, since the vulnerability does not impact confidentiality or integrity, data breaches or unauthorized data modification are not direct concerns. The medium severity rating suggests that while the threat is significant, it is not critical, and mitigation is feasible through patching or input validation.

Mitigation Recommendations

European organizations should promptly upgrade the Hugging Face Transformers library to version 4.51.0 or later, where the vulnerability is fixed. If immediate upgrading is not possible, implement input validation or sanitization to restrict or reject suspicious configuration file names that could trigger the vulnerable regex pattern. Monitoring CPU usage and application response times can help detect potential exploitation attempts. Employing runtime application self-protection (RASP) or Web Application Firewalls (WAFs) with rules to detect abnormal request patterns targeting configuration file loading endpoints may provide additional defense. Developers should review and refactor any custom regular expressions in their codebase to avoid similar inefficiencies. Finally, incorporating fuzz testing and performance profiling for regex patterns during development can prevent future ReDoS vulnerabilities.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
@huntr_ai
Date Reserved
2025-04-04T12:40:57.226Z
Cvss Version
3.0
State
PUBLISHED

Threat ID: 686b9cd16f40f0eb72e2e23d

Added to database: 7/7/2025, 10:09:21 AM

Last enriched: 7/7/2025, 10:26:58 AM

Last updated: 8/8/2025, 8:45:33 PM

Views: 10

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats