CVE-2025-3933 json
Regular Expression Denial of Service (ReDoS) in huggingface/transformers
published 2025-07-11 15 mo ago modified 2026-09-10 1 mo ago also GHSA-37mw-44qp-f5jm , PYSEC-2026-1977 , EUVD-2025-21126
- cvss
- 5.3
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 42%
- public exploits
- 0
- none known
Summary
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically within the DonutProcessor class's `token2json()` method. This vulnerability affects versions 4.50.3 and earlier, and is fixed in version 4.52.1. The issue arises from the regex pattern `<s_(.*?)>` which can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. This vulnerability can lead to service disruption, resource exhaustion, and potential API service vulnerabilities, impacting document processing tasks using the Donut model.
Patch / fix
- pypi transformers 4.52.1
- huggingface huggingface/transformers 4.52.1
- github.com/huggingface/transformers@ebbe9b1 commit
- github.com/huggingface/transformers#37788 pull request
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-3933 updated cvss 5.3
transformers: Regular Expression Denial of Service (ReDoS) in huggingface/transformers
-
Red Hat OpenShift Lightspeed openshift-lightspeed/lightspeed-service-api-rhel9, openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 Red Hat AI Inference Server rhaiis/vllm-cuda-rhel9, rhaiis/vllm-rocm-rhel9 Red Hat Ansible Automation Platform 2 ansible-automation-platform-24/de-minimal-rhel8, ansible-automation-platform-24/de-minimal-rhel9, ansible-automation-platform-25/de-minimal-rhel8, ansible-automation-platform-25/de-minimal-rhel9, ansible-automation-platform-24/ee-supported-rhel8, ansible-automation-platform-24/ee-supported-rhel9, +5 more Red Hat Enterprise Linux AI (RHEL AI) rhelai1/gemma-2-9b-it, rhelai1/bootc-amd-rhel9, rhelai1/bootc-intel-rhel9, rhelai1/gemma-2-9b-it-fp8, rhelai1/skills-adapter-v3, rhelai1/bootc-nvidia-rhel9, +24 more Red Hat OpenShift AI (RHOAI) rhoai/odh-mm-rest-proxy-rhel9, rhoai/odh-model-registry-rhel9, rhoai/odh-kueue-controller-rhel9, rhoai/odh-mlmd-grpc-server-rhel9, rhoai/odh-training-operator-rhel8, rhoai/odh-training-operator-rhel9, +9 moreaffected: workaround, no fix available “Fix deferred”
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 15 mo ago
Exploit prediction
0.50% chance of exploitation in the next 30 days, higher than 42% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- huntr.com https://huntr.com/bounties/25282953-5827-4384-bb6f-5790d275721b referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 5.3 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| NVD | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| OSV | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | transformers | <4.52.1 |
4.52.1 |
Affected products
- huggingface huggingface/transformers
Classification
- Weakness
-
- CWE-1333 Inefficient Regular Expression Complexity
References
-
github.com
/huggingface/transformers/commit/ebbe9b12dd75b69f92100d684c47f923ee262a93
web, patch
-
github.com
/huggingface/transformers/pull/37788
web
-
huntr.com
/bounties/25282953-5827-4384-bb6f-5790d275721b
web, exploit, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2025-3933
advisory
-
github.com
/huggingface/transformers
package
-
pypi.org
/project/transformers
package
-
github.com
/advisories/GHSA-37mw-44qp-f5jm
advisory
Sources
- CVE List CVE-2025-3933
- GitHub Advisory GHSA-37mw-44qp-f5jm
- NVD CVE-2025-3933
- OSV PYSEC-2026-1977
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.