Skip to main content
CVE-2025-57809VulnerabilityPublished

CVE-2025-57809: mlc-ai xgrammar · Uncontrolled Recursion

Affects mlc-ai xgrammarSource CVE Database V5

0

Not known to be exploited · CVSS 7.7 High : upgrade to 0.1.21 soon.

Data as of 26 Oct 2026, 06:26 UTC

CVSS 4.0 base score
7.7High
How severe the flaw is on the 0–10 CVSS scale.
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:P

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 25 Aug 2025

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
mlc-ai xgrammarAffected
  • <0.1.21
Fixed in
  • 0.1.21

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.

References

Community reviews

Loading reviews…