Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-48942 Overview
CVE-2025-48942 is a denial of service vulnerability in vLLM, an inference and serving engine for large language models (LLMs). The flaw affects versions 0.8.0 through 0.9.0 (exclusive). An authenticated client can crash the vLLM server by sending a request to the /v1/completions API with an invalid json_schema as a Guided Decoding parameter. The server fails to validate the schema before passing it to the xgrammar backend, causing an uncaught exception that terminates the engine process. This vulnerability is categorized as [CWE-248] Uncaught Exception. It is closely related to CVE-2025-48943, which covers the same crash pattern for invalid regex grammars.
Critical Impact
An authenticated attacker can terminate the vLLM inference engine with a single malformed /v1/completions request, disrupting LLM-serving availability for all tenants on the instance.
Affected Products
- vLLM version 0.8.0
- vLLM versions 0.8.x up to but excluding 0.9.0
- Deployments exposing the /v1/completions OpenAI-compatible API with guided decoding enabled
Discovery Timeline
- 2025-05-30 - CVE-2025-48942 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-48942
Vulnerability Analysis
vLLM exposes an OpenAI-compatible API that supports guided decoding, allowing callers to constrain model output using a JSON schema, regex, or grammar. When a client posts a request containing a malformed json_schema in the guided_decoding parameters, the xgrammar backend attempts to compile the schema into a grammar. The compilation raises an exception that was not caught by the request-handling path. Instead of returning an HTTP 400 to the caller, the exception propagated into the engine worker and terminated the process.
The result is a complete loss of inference service. Any concurrent requests fail, and the server must be restarted to resume operation. Because vLLM is commonly deployed as a shared backend for multiple applications or tenants, a single malformed request from any authenticated user can affect every downstream consumer.
Root Cause
The root cause is missing input validation in the guided-decoding pipeline [CWE-248]. The vllm/v1/structured_output/backend_xgrammar.py module invoked xgr.Grammar.from_json_schema(schema) without wrapping the call in exception handling. Request preprocessing in vllm/v1/engine/processor.py likewise failed to validate the grammar before dispatching the request to the engine, so malformed input reached the backend and crashed it.
Attack Vector
Exploitation requires network access to the vLLM API and valid credentials where authentication is enforced. The attacker crafts a POST /v1/completions payload containing a guided_json or equivalent json_schema field with syntactically invalid or structurally unsupported content. Submitting the request causes xgrammar to raise during schema transformation, taking the engine with it.
# Patch excerpt - vllm/v1/structured_output/backend_xgrammar.py
else:
schema = gd_params.json
+ try:
+ xgr.Grammar.from_json_schema(schema)
+ except Exception as err:
+ raise ValueError("Failed to transform json schema into a grammar: "
+ f"{err}") from err
+
if has_xgrammar_unsupported_json_features(schema):
raise ValueError("The provided JSON schema contains features not "
"supported by xgrammar.")
# Source: https://github.com/vllm-project/vllm/commit/08bf7840780980c7568c573c70a6a8db94fd45ff
The companion change in vllm/v1/engine/processor.py adds a fallback to the guidance backend when xgrammar validation fails, so malformed-but-recoverable requests return an HTTP 400 instead of killing the worker:
validate_xgrammar_grammar(params)
params.guided_decoding.backend = "xgrammar"
except ValueError:
- # The request includes some jsonschema feature(s) that
+ # The request either failed validation
+ # or includes some jsonschema feature(s) that
# are not supported in xgrammar. Fall back to guidance.
+ validate_guidance_grammar(params, tokenizer=None)
params.guided_decoding.backend = "guidance"
# Remember that this backend was set automatically
params.guided_decoding.backend_was_auto = True
# Source: https://github.com/vllm-project/vllm/commit/08bf7840780980c7568c573c70a6a8db94fd45ff
Detection Methods for CVE-2025-48942
Indicators of Compromise
- Unexpected termination of the vLLM engine process shortly after a POST /v1/completions request containing guided_json or guided_decoding fields.
- Stack traces in vLLM logs referencing xgr.Grammar.from_json_schema or backend_xgrammar.py.
- A spike in HTTP 5xx responses followed by connection resets from the vLLM endpoint.
Detection Strategies
- Parse vLLM application logs for uncaught exceptions originating in the structured-output or guided-decoding modules.
- Correlate inference-engine restarts in orchestrator logs (Kubernetes, systemd) with the preceding client request on the API gateway.
- Alert on repeated malformed guided_json payloads from the same API key or source IP within a short window.
Monitoring Recommendations
- Track engine liveness and restart counts using Prometheus or your container platform's health metrics.
- Log and retain request bodies for /v1/completions at the proxy layer so malformed schemas can be reconstructed during incident review.
- Monitor per-client error-rate ratios to surface tenants submitting disproportionate numbers of invalid guided-decoding requests.
How to Mitigate CVE-2025-48942
Immediate Actions Required
- Upgrade vLLM to version 0.9.0 or later, which contains the fix in commit 08bf784.
- Audit which clients and services are permitted to submit guided_decoding parameters and revoke credentials that are not required.
- Place the vLLM API behind an authenticating reverse proxy and reject anonymous requests to /v1/completions.
Patch Information
vLLM version 0.9.0 resolves the issue. The fix validates the JSON schema inside backend_xgrammar.py and falls back to the guidance backend in processor.py, returning an HTTP 400 error to the client instead of crashing the engine. See the GitHub Security Advisory GHSA-6qc9-v4r8-22xg, pull request #17623, and upstream commit 08bf784 for the full change set.
Workarounds
- Disable guided decoding in deployments where it is not required by rejecting requests containing guided_json, guided_regex, or guided_grammar fields at the API gateway.
- Validate client-supplied JSON schemas with a lightweight preflight check before forwarding them to vLLM.
- Run multiple vLLM replicas behind a load balancer with automatic restart so a single crash does not fully interrupt service while patching is scheduled.
# Upgrade to patched vLLM release
pip install --upgrade "vllm>=0.9.0"
# Verify installed version
python -c "import vllm; print(vllm.__version__)"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

