CVE-2025-3263: Transformers's ReDoS vulnerability in get_configuration_file can lead to catastrophic backtracking
Hugging Face Transformers before 4.51.0 has a regular-expression denial of service in get_configuration_file() in transformers.configuration_utils. A crafted file name makes the regex backtrack catastrophically and pins a CPU core. Upgrade to 4.51.0.
Published Jul 7, 2025 · Updated Jul 8, 2025 · Analysis Nov 10, 2026
What an attacker can do
get_configuration_file() matches configuration file names against the pattern config\.(.*)\.json. The greedy, unanchored group lets a crafted input string force catastrophic backtracking, so matching time grows sharply with input length.
The practical effect is availability loss: the process that runs the call spins on one CPU core. The advisory text names model serving disruption, resource exhaustion and higher latency. It does not give code execution or data exposure, and the CVSS 3.0 vector (network, no privileges, low availability impact, score 5.3) matches that.
An attacker needs a way to get a crafted file name or repository listing into the function. That is most plausible in a service that loads models or configs from locations a user can influence, such as a model hub repository or a user-supplied model path.
Who is affected
The pip package transformers, versions before 4.51.0. The advisory text names 4.49.0 specifically. Check your install:
pip show transformersServices that load models or configs from paths or repositories chosen by users are the exposed case.
transformers
- Ecosystem
- PyPI
- Affected
- < 4.51.0
- Fixed in
- 4.51.0
- Check
pip show transformers
How to fix it
Upgrade to 4.51.0:
pip install --upgrade transformers==4.51.0The sources list no workaround. If you cannot upgrade, do not let untrusted users choose the model repository or path your service loads, and put timeouts on model-loading requests.
How to tell if you were hit
Look for worker processes stuck at 100% CPU inside transformers.configuration_utils, for model-load requests that time out, and for stack traces that end in the re module under get_configuration_file. The sources name no log line for this flaw.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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.
Questions
- Which Transformers version fixes CVE-2025-3263?
4.51.0. The advisory text says 4.49.0 is affected, and the package data marks all earlier versions as vulnerable.
- Can this lead to code execution?
No. It is a denial of service through catastrophic regex backtracking, so it uses CPU and slows or stalls the process.
- Which regex is the problem?
The advisory names the pattern config\.(.*)\.json in get_configuration_file().
- Is it a related flaw to the DonutProcessor ReDoS?
It is the same kind of flaw in a different place. The DonutProcessor issue is CVE-2025-3933 and is fixed in 4.52.1.
References
Read for this analysis:
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Transformers vulnerabilities
All Transformers entriesCVE-2026-80047
Hugging Face Transformers downloads custom generation code before trust consent
high7.8No fixSep 1, 2026CVE-2026-9856
Transformers save_pretrained path traversal allows arbitrary file writes through chat template names
high7.1Aug 2, 2026CVE-2026-5241
huggingface/transformers: Arbitrary Code Execution During Model Initialization in the LightGlue Model Loading Path
high8.0Jun 3, 2026CVE-2026-4372
HuggingFace transformers vulnerable to remote code execution
high7.8May 26, 2026CVE-2026-1839
HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class
medium6.5Apr 7, 2026CVE-2025-6921
Hugging Face Transformers vulnerable to Regular Expression Denial of Service (ReDoS) in the AdamWeightDecay optimizer
medium5.3Sep 23, 2025
