NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · vLLM

GHSA-hf3c-wxg2-49q9: vLLM vulnerable to Denial of Service by abusing xgrammar cache

mediumCVSS 3.1 6.5

vLLM 0.6.5 up to 0.8.4 uses the xgrammar library for structured output, and xgrammar caches every compiled grammar in RAM. A user who sends many short requests with unique schemas can fill all the memory and deny service. Fixed in vLLM 0.8.4.

Published Apr 15, 2025 · Analysis Nov 1, 2026

What an attacker can do

xgrammar is the default backend for structured output (guided decoding) in vLLM. It has a required built-in cache of compiled grammars, held in RAM. Each request with a new schema adds an entry. The advisory describes the abuse: a stream of very short decoding requests, each with a unique schema, grows the cache until the system runs out of memory.

The attacker needs access to the OpenAI-compatible API server with low privileges, and no other action. The API serves xgrammar by default on both the V0 and V1 engines. On V0, a client can also pick xgrammar per request with the guided_decoding_backend key in extra_body, even when the server default is another backend. That per-request choice does not exist on V1.

When memory runs out, the server slows, is killed by the OOM killer, or fails other users' requests. The advisory names no data exposure or code execution. The underlying cause is in xgrammar, which has its own advisory.

Who is affected

Affected: vLLM from 0.6.5 up to but not including 0.8.4. Check:

pip show vllm

Any deployment whose OpenAI-compatible API accepts structured-output requests from untrusted clients is exposed.

vllm

Ecosystem
PyPI
Affected
>= 0.6.5, < 0.8.4
Fixed in
0.8.4
Check
pip show vllm

How to fix it

Upgrade to vLLM 0.8.4:

pip install --upgrade vllm==0.8.4

The fix is in pull request 16283. The advisory says there is no workaround for existing versions other than preventing untrusted access to the OpenAI-compatible API server. Put authentication and rate limits in front of it.

How to tell if you were hit

Watch the memory use of the vLLM process: steady growth with no matching growth in concurrent requests is the sign. Check request logs for a client sending many short requests with different JSON schemas or grammar definitions. Look for OOM-killer entries in the system log. The advisory lists no log line.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

This report is to highlight a vulnerability in XGrammar, a library used by the structured output feature in vLLM. The XGrammar advisory is here: https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-389x-67px-mjg3

The xgrammar library is the default backend used by vLLM to support structured output (a.k.a. guided decoding). Xgrammar provides a required, built-in cache for its compiled grammars stored in RAM. xgrammar is available by default through the OpenAI compatible API server with both the V0 and V1 engines.

A malicious user can send a stream of very short decoding requests with unique schemas, resulting in an addition to the cache for each request. This can result in a Denial of Service by consuming all of the system's RAM.

Note that even if vLLM was configured to use a different backend by default, it is still possible to choose xgrammar on a per-request basis using the guided_decoding_backend key of the extra_body field of the request with the V0 engine. This per-request choice is not available when using the V1 engine.

Patches

  • https://github.com/vllm-project/vllm/pull/16283

Workarounds

There is no way to workaround this issue in existing versions of vLLM other than preventing untrusted access to the OpenAI compatible API server.

References

  • https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-389x-67px-mjg3

Credited to russellb.

Questions

Does this need a special setting?

No. xgrammar is the default structured output backend, on both V0 and V1. On V0 a client can also select it per request, even if the server default is different.

Is there a workaround?

Only keeping untrusted users away from the OpenAI-compatible API. The advisory lists no configuration workaround. Upgrade to 0.8.4.

Is there a CVE for this?

This record has only the GitHub advisory id GHSA-hf3c-wxg2-49q9. The advisory links to a related xgrammar advisory, since the flaw is in that library's cache.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More vLLM vulnerabilities

All vLLM entries