Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. xgrammar
  4. ›
  5. CVE-2025-32381

CVE-2025-32381: xgrammar Vulnerable to Denial of Service (DoS) by abusing unbounded cache in memory

April 9, 2025 (updated June 8, 2026)

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.

References

  • github.com/advisories/GHSA-389x-67px-mjg3
  • github.com/mlc-ai/xgrammar/pull/243
  • github.com/mlc-ai/xgrammar/security/advisories/GHSA-389x-67px-mjg3
  • github.com/pypa/advisory-database/tree/main/vulns/xgrammar/PYSEC-2025-235.yaml
  • github.com/vllm-project/vllm/pull/16283
  • nvd.nist.gov/vuln/detail/CVE-2025-32381

Code Behaviors & Features

Detect and mitigate CVE-2025-32381 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.1.18

Fixed versions

  • 0.1.18

Solution

Upgrade to version 0.1.18 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-770: Allocation of Resources Without Limits or Throttling

Source file

pypi/xgrammar/CVE-2025-32381.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:09 +0000.