CVE-2025-57809: mlc-ai xgrammar · Uncontrolled Recursion
Affects mlc-ai xgrammarSource CVE Database V5
Not known to be exploited · CVSS 7.7 High : upgrade to 0.1.21 soon.
Data as of 26 Oct 2026, 06:26 UTC
- EPSS
- 0.4% chance of exploitation in 30 days – higher than 41% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 0.1.21
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:PExploitation evidence
Disclosed: evidence found.
CVE published 25 Aug 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.
What to do
Upgrade mlc-ai xgrammar to 0.1.21.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| mlc-ai xgrammar | Affected
| Fixed in
|
AI-suggested
European organizations should immediately audit their software dependencies to identify any usage of xgrammar versions prior to 0.1.21. Where found, upgrading to version 0.1.21 or later is the primary mitigation step. If upgrading is not immediately feasible, organizations should implement input validation to detect and block inputs that could trigger recursive grammar expansions. Employing runtime monitoring to detect abnormal CPU or memory usage patterns indicative of infinite recursion can enable early detection and mitigation of exploitation attempts. Additionally, sandboxing or isolating components using xgrammar can limit the impact of potential crashes. Organizations should also subscribe to mlc-ai and relevant security advisories to receive timely updates on patches and exploit reports. Incorporating fuzz testing focused on grammar inputs can help identify similar recursion issues proactively in custom grammar definitions. Finally, integrating automated dependency scanning tools into the CI/CD pipeline can prevent vulnerable versions from being deployed.
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.