CVE-2025-32381
MEDIUM 6.5CVSS 3.1xgrammar Vulnerable to Denial of Service (DoS) by abusing unbounded cache in memory
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.
- Published
- 9 Apr 2025
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-770
- Also known as
- GHSA-389x-67px-mjg3PYSEC-2025-235
- Sources
- NVDJSONOSV GHSA-389x-67px-mjg3JSONOSV PYSEC-2025-235JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| OSV | PyPA | CVSS 3.1 | MEDIUM 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | mlc-ai | xgrammarcpe:2.3:a:mlc-ai:xgrammar:*:*:*:*:*:*:*:* |
< 0.1.18 | 0.1.18 |
| OSV | PyPI | xgrammar | < 0.1.18 | 0.1.18 |
References
- https://github.com/mlc-ai/xgrammar/pull/243 · Issue Tracking, Patch, WEB, FIX
- https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-389x-67px-mjg3 · Vendor Advisory, WEB, ADVISORY
- https://github.com/vllm-project/vllm/pull/16283 · Issue Tracking, Patch, WEB, FIX
- https://nvd.nist.gov/vuln/detail/CVE-2025-32381 · ADVISORY
- https://github.com/mlc-ai/xgrammar · PACKAGE
- https://github.com/pypa/advisory-database/tree/main/vulns/xgrammar/PYSEC-2025-235.yaml · WEB
History
- 25 Nov 2026 20:57 UTC · NVD: first stored (published 9 Apr 2025)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 9 Apr 2025)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 9 Apr 2025)