Skip to content
MediumVulnerabilityLLM-specific

GHSA-9q5r-wfvf-rr7f: xgrammar vulnerable to denial of service by huge enum grammar

Published
Record updated
View JSON
Affected
  • xgrammar = 0.1.23
Fixed in
0.1.24
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.7%Estimated probability that this CVE is exploited in the next 30 days, from the FIRST Exploit Prediction Scoring System. Read on .

Summary

A regression in xgrammar 0.1.23, traced to the Earley parser and the grammar optimizer introduced in v0.1.23, makes very large JSON schema grammars (over 100k characters, around 70k tokens) take minutes to process, where 0.1.16 handled them fine. The grammar parsing alone can take longer than LLM inference, so an attacker can use a crafted schema with a huge enum to denial-of-service model providers.

Mitigation

v0.1.24 solved this problem by optimizing the speed of the grammar optimizer and disabling some slow optimizations for large grammars.