{"id":"CVE-2025-58446","published":"2025-09-06T19:06:10Z","modified":"2025-09-08T17:55:13Z","title":"xgrammar vulnerable to denial of service by huge enum grammar","vendor":"mlc-ai","product":"xgrammar","tier":"tail","description":{"text":"xgrammar is an open-source library for efficient, flexible, and portable structured generation. A grammar optimizer introduced in 0.1.23 processes large grammars (>100k characters) at very low rates, and can be used for DOS of model providers. This issue is fixed in version 0.1.24.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.9,"severity":"MEDIUM","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00619,"percentile":0.50577,"provenance":"source"},"cwes":[{"id":"CWE-770","name":"Allocation of Resources Without Limits or Throttling"}],"references":[{"url":"https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-9q5r-wfvf-rr7f","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/mlc-ai/xgrammar/commit/ced69c3ad2f8f61b516cc278a342e7c644383e27","tags":["x_refsource_MISC"]}],"priority":{"score":14.9,"factors":[{"name":"EPSS percentile","points":10.12},{"name":"CVSS severity","points":4.83}]},"vendorSlug":"mlc-ai","affectedVersions":[{"vendor":"mlc-ai","product":"xgrammar","versions":["= 0.1.23, <  0.1.24"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-09-08T17:53:36.884881Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"xgrammar","vulnerableRanges":[">=0.1.23, <0.1.24"],"patched":["0.1.24"],"from":["GHSA-9q5r-wfvf-rr7f","PYSEC-2026-2055"],"provenance":"source"}],"summary":{"text":"The xgrammar library (product from mlc-ai) has a flaw in its grammar optimizer, introduced in version 0.1.23, that processes very large grammars, over 100k characters, at very low rates, resulting in resource exhaustion from unbounded processing. An unauthenticated remote attacker with network access and no user interaction can submit such a large grammar to cause denial of service against a model provider running the affected library, with no special configuration required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:32:53Z"},"euvd":{"id":"EUVD-2025-27083","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-mlc-ai-xgrammar-cve-2025-57809","parents":[{"from":"CVE-2025-57809","to":"CVE-2025-58446","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["cpp/earley_parser.cc","cpp/earley_parser.h","cpp/grammar_compiler.cc","cpp/grammar_matcher.cc"],"commits":["https://github.com/mlc-ai/xgrammar/commit/b943feacb5a1caf4d39de8ec3bf7c7ce066dcee5","https://github.com/mlc-ai/xgrammar/commit/ced69c3ad2f8f61b516cc278a342e7c644383e27"],"basis":"shared function","functions":["AcceptToken","GrammarMatcherForTokenMaskCache","IsTokenPassLookaheadAssertion","MultiThreadCompileGrammar"]}]}],"packageHistory":[{"cve":"CVE-2025-32381","published":"2025-04-09","fixed":"0.1.18","kev":false},{"cve":"CVE-2025-57809","published":"2025-08-25","fixed":"0.1.21","kev":false},{"cve":"CVE-2025-58446","published":"2025-09-06","fixed":"0.1.24","kev":false},{"cve":"CVE-2026-25048","published":"2026-03-05","fixed":"0.1.32","kev":false,"link":{"from":"CVE-2025-58446","to":"CVE-2026-25048","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:xgrammar","fromFixed":"0.1.24","toFixed":"0.1.32","daysApart":180}]}}],"package":"PyPI:xgrammar"}}