Vulnerabilities · 2025 · Huggingface
CVE-2025-3933
Huggingface Transformers vulnerability
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.
Affected products
Transformers. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Huggingface Transformers runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Limit access until thenIf you cannot update at once, take the system off the internet or restrict who can reach it.
References
- github.com/huggingface/transformers/commit/ebbe9b12dd75b69f92100d684c47f923ee262a93 · Patch
- huntr.com/bounties/25282953-5827-4384-bb6f-5790d275721b · Exploit
- nvd.nist.gov/vuln/detail/CVE-2025-3933
- github.com/huggingface/transformers/pull/37788
- github.com/advisories/GHSA-37mw-44qp-f5jm
- nvd.nist.gov/vuln/detail/CVE-2025-3933
- cve.org/CVERecord?id=CVE-2025-3933
More vulnerabilities in Huggingface products
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.