Hugging Face Transformers is vulnerable to ReDoS through its MarianTokenizer
CVE-2025-6638 · GHSA-59p9-h35m-wg4g · published 2025-09-12 · updated 2025-09-15
- Severity
- Medium
- CVSS score
- 5.3
- Chance of exploitation (EPSS)
- 0.56%
- Fixed in
- 4.53.0
- Exploitation Public proof of concept
- Automatable Yes
- Technical impact Partial
- CISA SSVC
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically affecting the MarianTokenizer's removelanguagecode() method. This vulnerability is present in version 4.52.4 and has been fixed in version 4.53.0. The issue arises from inefficient regex processing, which can be exploited by crafted input strings containing malformed language code patterns, leading to excessive CPU consumption and potential denial of service.
Upgrade transformers to 4.53.0 or later.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| transformers | PyPI | < 4.53.0 | 4.53.0 |
- HightsParticles: Unbounded HTTP Request Body Buffering in @tsparticles/mcp-server Leads to Remote DoS@tsparticles/mcp-server
- HighMissing request-wide media budget allows single-request frontend resource exhaustionvllm
- HighMCP TypeScript SDK: HTTP server transports and handlers did not limit request body size or JSON-RPC batch length@modelcontextprotocol/hono, @modelcontextprotocol/node, @modelcontextprotocol/sdk, @modelcontextprotocol/server
- HighvLLM : DoS via unvalidated mm_processor_kwargs in multimodal image processors (Isaac, InternVL, H2OVL, etc.)vllm
- HighMCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation@modelcontextprotocol/sdk, @modelcontextprotocol/server
- HighFrame-count cap bypass in VideoMediaIO.load_base64 for video/jpeg via media_io_kwargs.video.num_framesvllm
- Criticaltransformers has a Deserialization of Untrusted Data vulnerabilitytransformers
- HighHugging Face Transformers downloads custom generation code before trust consenttransformers
- HighTransformers save_pretrained path traversal allows arbitrary file writes through chat template namestransformers
- Highhuggingface/transformers: Arbitrary Code Execution During Model Initialization in the LightGlue Model Loading Pathtransformers
- HighHuggingFace transformers vulnerable to remote code executiontransformers
- HighDeserialization of Untrusted Data in Hugging Face Transformerstransformers
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.