Skip to content
MediumVulnerabilityLLM-specific

GHSA-389x-67px-mjg3: xgrammar Vulnerable to Denial of Service (DoS) by abusing unbounded cache in memory

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

Summary

xgrammar keeps an in-memory cache of compiled grammars that has no size limit. Because of this, an attacker can send many small requests with unique JSON schemas to an LLM inference server and exhaust the host's memory, causing a denial of service. Any system that takes requests from untrusted parties is affected.

Mitigation

The fix adds a size limit to the cache, done in https://github.com/mlc-ai/xgrammar/pull/243. vLLM shows an example of using the new cache size limit: https://github.com/vllm-project/vllm/pull/16283