# CVE-2025-3264: Regular Expression Denial of Service (ReDoS) in huggingface/transformers

- Severity: Medium 5.3 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.50%, higher than 44% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-07-07T09:55:11.030Z
- Modified: 2026-07-07T17:56:51.899Z
- Also known as: GHSA-jjph-296x-mrcr, PYSEC-2026-1985
- Weaknesses: CWE-1333
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: @huntr_ai

## Description

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, specifically in the `get_imports()` function within `dynamic_module_utils.py`. This vulnerability affects versions 4.49.0 and is fixed in version 4.51.0. The issue arises from a regular expression pattern `\s*try\s*:.*?except.*?:` used to filter out try/except blocks from Python code, which can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. This vulnerability can lead to remote code loading disruption, resource exhaustion in model serving, supply chain attack vectors, and development pipeline disruption.

(As written by CVE List.)

## Affected

- huggingface huggingface/transformers: from unspecified before 4.51.0
- transformers (PyPI): before 4.51.0
- huggingface transformers: from 4.49.0 before 4.51.0

## Every score

- @huntr_ai: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- PyPA Advisory Database: CVSS:3.0 5.3 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

## References

- <https://huntr.com/bounties/3c6f7822-9992-476d-8cf0-b0b1623427df> (exploit, third-party-advisory, web)
- <https://github.com/huggingface/transformers/commit/0720e206c6ba28887e4d60ef60a6a089f6c1cc76> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-3264> (advisory)
- <https://github.com/huggingface/transformers/commit/126abe3461762e5fc180e7e614391d1b4ab051ca> (web)
- <https://github.com/huggingface/transformers> (package)
- <https://pypi.org/project/transformers> (package)
- <https://github.com/advisories/GHSA-jjph-296x-mrcr> (advisory)

## Sources

- CVE List: [CVE-2025-3264](https://www.cve.org/CVERecord?id=CVE-2025-3264), CVE Terms of Use, modified 2025-07-07
- GitHub Advisory Database: [GHSA-jjph-296x-mrcr](https://github.com/advisories/GHSA-jjph-296x-mrcr), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2025-3264](https://nvd.nist.gov/vuln/detail/CVE-2025-3264), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1985](https://osv.dev/vulnerability/PYSEC-2026-1985), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-3264 · Whole record: https://cve.day/CVE-2025-3264.json · Rebuilt by cve.day 2026-11-25T22:59:00.716Z
