Vulnerability · Published Aug 25, 2025 · Assigned by GitHub_M

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

High 7.7

In plain English

A high-severity security flaw in xgrammar from mlc-ai. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 42% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)7.7High
Exploit odds (30 days)0.5%top 58.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
PyPIxgrammar0.1.21GHSA-5cmr-4px5-23pc
PyPIxgrammar0.1.21PYSEC-2026-2054

Affected products (as reported)

VendorProductVersions
mlc-ai xgrammar < 0.1.21

Weakness: CWE-674 · Vector: 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