Denial of Service by abusing xgrammar unbounded cache in memory
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-770.
Summary
XGrammar is an open-source library for efficient, flexible, and portable structured generation. Prior to 0.1.18, Xgrammar includes a cache for compiled grammars to increase performance with repeated use of the same grammar. This cache is held in memory. Since the cache is unbounded, a system making use of xgrammar can be abused to fill up a host's memory and case a denial of service. For example, sending many small requests to an LLM inference server with unique JSON schemas would eventually cause this denial of service to occur. This vulnerability is fixed in 0.1.18.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| mlc-ai | xgrammar | before 0.1.18 | 0.1.18 | Patch available | CNA |
| — | xgrammar (PyPI) | before 0.1.18 | 0.1.18 | Patch available | GHSA-389x-67px-mjg3 |
- xgrammar Vendormlc-ai Affected before 0.1.18 Fixed in 0.1.18 Patch available CNA
- xgrammar (PyPI) Vendor— Affected before 0.1.18 Fixed in 0.1.18 Patch available GHSA-389x-67px-mjg3
Remediation
- Fix · CNA xgrammar (mlc-ai) Fixed in 0.1.18
- Fix · GHSA-389x-67px-mjg3 xgrammar (PyPI) Fixed in 0.1.18 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux AI (RHEL AI) | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2025-32381
- 2026-10-03 Alias added: GHSA-389x-67px-mjg3
References
Advisory 2
More mlc-ai Xgrammar vulnerabilities
- TI-2025-36204 xgrammar vulnerable to denial of service by huge enum grammar CVSS 4.0MEDIUM 6.9
- TI-2026-20232 xgrammar: Multi-layer nesting causes DoS CVSS 4.0HIGH 8.7
- TI-2025-35692 XGrammar affected by Denial of Service by infinite recursion grammars CVSS 4.0HIGH 7.7
Sources
- CVE-2025-32381 · CVE Program
- CVE-2025-32381 · NVD
- FIRST EPSS
- GHSA-389x-67px-mjg3 · GitHub Advisory Database · CC BY 4.0
- CVE-2025-32381 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences