CVE-2025-3263: Transformers Library ReDoS Vulnerability in get_configuration_file Function

transformers Updated 02 Oct 2025

Summary

07/07/2025
Yes i
Moderate
5.3

CVE-2025-3263: Transformers's ReDoS vulnerability in get_configuration_file can lead to catastrophic backtracking. Affects transformers versions < 4.51.0. Fixed in 4.51.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The Hugging Face Transformers library is a widely used open-source library that provides state-of-the-art machine learning models for natural language processing tasks. It allows users to easily implement and fine-tune models for various applications, making it a popular choice among developers and researchers. However, version 4.49.0 of this library has a vulnerability that can lead to performance issues due to a Regular Expression Denial of Service (ReDoS) attack.

Vulnerability Detail

A Regular Expression Denial of Service (ReDoS) vulnerability exists in the get_configuration_file() function of the Transformers library. This vulnerability is caused by a poorly constructed regular expression pattern config\.(.*)\.json, which can be exploited by providing specially crafted input strings. When triggered, this can lead to excessive CPU consumption, resulting in model serving disruptions, resource exhaustion, and increased latency in applications that utilize the library.

How To Fix

Latest published version: 5.20.2 as of 22 Oct 2026

pip install --upgrade "transformers==5.20.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.51.0

This is the first release that contains the fix.

pip install --upgrade "transformers==4.51.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can avoid using the get_configuration_file() function with potentially malicious input. Additionally, consider implementing input validation to prevent the use of crafted strings that could exploit the vulnerability.

Conclusion

The ReDoS vulnerability in the Hugging Face Transformers library's get_configuration_file() function poses a risk of performance degradation and service disruption. It is crucial to update to version 4.51.0 or later to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for transformers →

Share this vulnerability

FAQ

A ReDoS vulnerability occurs when a regular expression can be exploited to cause excessive backtracking, leading to high CPU usage and potential denial of service.

Version 4.49.0 of the Transformers library is affected by this vulnerability.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If you cannot update the library immediately, implement input validation to prevent the use of crafted strings that could exploit the vulnerability.

The CVSS score of this vulnerability is 5.3, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for transformers.

How To Fix

Latest published version: 5.20.2 as of 22 Oct 2026

pip install --upgrade "transformers==5.20.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.51.0

This is the first release that contains the fix.

pip install --upgrade "transformers==4.51.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback