CVE-2025-32381 Details
Description
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.
A denial-of-service vulnerability has been identified in XGrammar, an open-source library for structured generation. Prior to version 0.1.18, XGrammar's cache for compiled grammars was unbounded and held in memory, allowing for abuse that could fill a host's memory and cause a denial-of-service condition. This issue could arise, for example, by sending numerous small requests with unique JSON schemas to an LLM inference server, eventually exhausting the server's resources. The vulnerability has been patched in version 0.1.18.
Users can upgrade to XGrammar version 0.1.18 or later, which includes a fix for this vulnerability by introducing a cache size limit. For applications like vLLM, the cache size limit can be adjusted using the 'VLLM_XGRAMMAR_CACHE_MB' environment variable.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 9, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/mlc-ai/xgrammar/pull/243 | [email protected] | Issue TrackingPatch |
| https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-389x-67px-mjg3 | [email protected] | Vendor Advisory |
| https://github.com/vllm-project/vllm/pull/16283 | [email protected] | Issue TrackingPatch |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-770 | Allocation of Resources Without Limits or Throttling | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| mlc-ai xgrammar | < 0.1.18 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Sep 17, 2025 | Initial Analysis | [email protected] |
| Apr 9, 2025 | New CVE Received | [email protected] |