CVE-2025-3933: CWE-1333 Inefficient Regular Expression Complexity in huggingface huggingface/transformers
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.
AI Analysis
Technical Summary
CVE-2025-3933 is a Regular Expression Denial of Service (ReDoS) vulnerability identified in the Hugging Face Transformers library, specifically within the DonutProcessor class's token2json() method. The vulnerability stems from the use of an inefficient regular expression pattern `<s_(.*?)>`, which is prone to catastrophic backtracking when processing specially crafted input strings. This inefficiency can cause excessive CPU consumption, leading to service degradation or denial of service conditions. The affected versions include 4.50.3 and earlier, with the issue resolved in version 4.52.1. The DonutProcessor is used in document processing tasks leveraging the Donut model, which is designed for document understanding and extraction. Exploiting this vulnerability does not require authentication or user interaction, and can be triggered remotely via network access to the affected API or service. The vulnerability impacts availability by exhausting computational resources, potentially disrupting API services or automated document processing pipelines that rely on the Hugging Face Transformers library. No impact on confidentiality or integrity has been reported. No known exploits are currently observed in the wild, but the medium CVSS score (5.3) reflects the moderate risk posed by this vulnerability due to its ease of exploitation and potential for service disruption.
Potential Impact
For European organizations, the impact of CVE-2025-3933 can be significant in environments where the Hugging Face Transformers library is integrated into document processing workflows, especially those using the Donut model for automated extraction and understanding of documents. Organizations in sectors such as finance, legal, healthcare, and government that rely on automated document parsing and analysis could face service interruptions or degraded performance, affecting business continuity and operational efficiency. The vulnerability could be exploited to cause denial of service conditions on public-facing APIs or internal services, potentially leading to downtime or increased operational costs due to resource exhaustion. While no direct data breach or integrity compromise is indicated, the disruption of availability can indirectly affect compliance with service level agreements and regulatory requirements for uptime and reliability. Additionally, organizations using cloud-based or hybrid deployments of these models may experience cascading effects if the vulnerability is triggered at scale.
Mitigation Recommendations
To mitigate CVE-2025-3933, European organizations should promptly upgrade the Hugging Face Transformers library to version 4.52.1 or later, where the vulnerability has been addressed. For environments where immediate upgrading is not feasible, implementing input validation and sanitization to detect and reject suspiciously crafted input strings targeting the `<s_(.*?)>` regex pattern can reduce exposure. Rate limiting and throttling API requests that invoke the DonutProcessor's token2json() method can help prevent resource exhaustion from repeated exploitation attempts. Monitoring CPU usage and setting alerts for anomalous spikes during document processing tasks can enable early detection of exploitation attempts. Additionally, isolating document processing workloads in containerized or sandboxed environments can limit the impact of potential denial of service conditions. Organizations should also review and update incident response plans to include scenarios involving ReDoS attacks on machine learning model APIs.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Italy, Spain
CVE-2025-3933: CWE-1333 Inefficient Regular Expression Complexity in huggingface huggingface/transformers
Description
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.
AI-Powered Analysis
Technical Analysis
CVE-2025-3933 is a Regular Expression Denial of Service (ReDoS) vulnerability identified in the Hugging Face Transformers library, specifically within the DonutProcessor class's token2json() method. The vulnerability stems from the use of an inefficient regular expression pattern `<s_(.*?)>`, which is prone to catastrophic backtracking when processing specially crafted input strings. This inefficiency can cause excessive CPU consumption, leading to service degradation or denial of service conditions. The affected versions include 4.50.3 and earlier, with the issue resolved in version 4.52.1. The DonutProcessor is used in document processing tasks leveraging the Donut model, which is designed for document understanding and extraction. Exploiting this vulnerability does not require authentication or user interaction, and can be triggered remotely via network access to the affected API or service. The vulnerability impacts availability by exhausting computational resources, potentially disrupting API services or automated document processing pipelines that rely on the Hugging Face Transformers library. No impact on confidentiality or integrity has been reported. No known exploits are currently observed in the wild, but the medium CVSS score (5.3) reflects the moderate risk posed by this vulnerability due to its ease of exploitation and potential for service disruption.
Potential Impact
For European organizations, the impact of CVE-2025-3933 can be significant in environments where the Hugging Face Transformers library is integrated into document processing workflows, especially those using the Donut model for automated extraction and understanding of documents. Organizations in sectors such as finance, legal, healthcare, and government that rely on automated document parsing and analysis could face service interruptions or degraded performance, affecting business continuity and operational efficiency. The vulnerability could be exploited to cause denial of service conditions on public-facing APIs or internal services, potentially leading to downtime or increased operational costs due to resource exhaustion. While no direct data breach or integrity compromise is indicated, the disruption of availability can indirectly affect compliance with service level agreements and regulatory requirements for uptime and reliability. Additionally, organizations using cloud-based or hybrid deployments of these models may experience cascading effects if the vulnerability is triggered at scale.
Mitigation Recommendations
To mitigate CVE-2025-3933, European organizations should promptly upgrade the Hugging Face Transformers library to version 4.52.1 or later, where the vulnerability has been addressed. For environments where immediate upgrading is not feasible, implementing input validation and sanitization to detect and reject suspiciously crafted input strings targeting the `<s_(.*?)>` regex pattern can reduce exposure. Rate limiting and throttling API requests that invoke the DonutProcessor's token2json() method can help prevent resource exhaustion from repeated exploitation attempts. Monitoring CPU usage and setting alerts for anomalous spikes during document processing tasks can enable early detection of exploitation attempts. Additionally, isolating document processing workloads in containerized or sandboxed environments can limit the impact of potential denial of service conditions. Organizations should also review and update incident response plans to include scenarios involving ReDoS attacks on machine learning model APIs.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- @huntr_ai
- Date Reserved
- 2025-04-25T13:37:56.821Z
- Cvss Version
- 3.0
- State
- PUBLISHED
Threat ID: 6870dd5da83201eaacadb457
Added to database: 7/11/2025, 9:46:05 AM
Last enriched: 7/11/2025, 10:01:11 AM
Last updated: 8/23/2025, 1:49:01 AM
Views: 26
Actions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.