# CVE-2025-57809: XGrammar affected by Denial of Service by infinite recursion grammars

- Severity: High 7.7 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P`
- 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.55%, higher than 47% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-08-25T20:43:45.000Z
- Modified: 2026-09-10T03:50:26.791Z
- Also known as: GHSA-5cmr-4px5-23pc, PYSEC-2026-2054
- Weaknesses: CWE-674
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

XGrammar is an open-source library for efficient, flexible, and portable structured generation. Prior to version 0.1.21, XGrammar has an infinite recursion issue in the grammar. This issue has been resolved in version 0.1.21.

(As written by CVE List.)

## Affected

- mlc-ai xgrammar: < 0.1.21; before 0.1.21
- xgrammar (PyPI): before 0.1.21

## Every score

- GitHub_M: CVSS:4.0 7.7 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:4.0 `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P`

## References

- <https://github.com/mlc-ai/xgrammar/issues/250> (exploit, issue-tracking, web)
- <https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-5cmr-4px5-23pc> (vendor-advisory, web)
- <https://github.com/mlc-ai/xgrammar/commit/b943feacb5a1caf4d39de8ec3bf7c7ce066dcee5> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-57809> (advisory)
- <https://github.com/mlc-ai/xgrammar> (package)
- <https://pypi.org/project/xgrammar> (package)
- <https://github.com/advisories/GHSA-5cmr-4px5-23pc> (advisory)

## Sources

- CVE List: [CVE-2025-57809](https://www.cve.org/CVERecord?id=CVE-2025-57809), CVE Terms of Use, modified 2025-08-26
- GitHub Advisory Database: [GHSA-5cmr-4px5-23pc](https://github.com/advisories/GHSA-5cmr-4px5-23pc), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-57809](https://nvd.nist.gov/vuln/detail/CVE-2025-57809), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-2054](https://osv.dev/vulnerability/PYSEC-2026-2054), CC-BY-4.0, modified 2026-07-07

---

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