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

CVE-2026-55574: vLLM: ReDoS via structured_outputs.regex compiled without timeout in xgrammar and outlines backends

highCVSS 4.0 8.7 · 3.1 7.5GHSA-rwxx-mrjm-wc2m

vLLM before 0.24.0 compiles the user-supplied `structured_outputs.regex` value with no time limit. One request with a pattern like `(a+)+b` can hang an inference worker indefinitely. No login is needed if the API is open. Fixed in vLLM 0.24.0, which adds a compile timeout of 5 seconds by default.

Published Jul 17, 2026 · Analysis Oct 25, 2026

What an attacker can do

The structured_outputs.regex request parameter lets a client force the model's output to match a regular expression. vLLM hands that string to a grammar backend to build a state machine. In the xgrammar backend, backend_xgrammar.py calls compile_regex() directly. In the outlines backend, validate_regex_is_buildable() rejects structural problems such as lookarounds and backreferences, but it cannot spot patterns that blow up the state space, and oc.Index() then runs with no deadline.

A pattern with nested quantifiers, such as (a+)+b, passes the checks and makes compilation run for an extremely long time. The worker that handles it is stuck, and the requests that wait on it stall too. The advisory describes this as one request hanging an inference worker indefinitely. The attacker needs only the ability to call a generation endpoint with structured outputs, and the CVSS vector says no privileges or user interaction. It rates availability impact only, at high.

The practical result is an outage for the shared inference server. Repeating the request keeps it down, and a restart does not help while the attacker keeps sending. No data is leaked and no code runs.

Who is affected

The pip package vllm at any version before 0.24.0. Servers using either the xgrammar or outlines structured-output backend are exposed, as long as a client can send structured_outputs.regex. A server that sits behind authentication limits who can send the request, but any holder of a valid key can still use it.

pip show vllm

vllm

Ecosystem
PyPI
Affected
< 0.24.0
Fixed in
0.24.0
Check
pip show vllm

How to fix it

Upgrade to vLLM 0.24.0:

pip install --upgrade "vllm>=0.24.0"

The fix, pull request 45118, adds a compile_regex_with_timeout() helper in vllm/v1/structured_output/utils.py. It runs compilation in a thread with a deadline, and the xgrammar and outlines backends both use it. The default timeout is 5 seconds. The environment variable VLLM_REGEX_COMPILATION_TIMEOUT_S sets it, and 0 turns the timeout off, so leave it set.

The advisory lists no workaround. Until you upgrade, put authentication in front of the API and consider filtering or rejecting structured_outputs.regex values at a gateway.

How to tell if you were hit

Look for inference workers or engine processes stuck at full CPU on a single request, with requests queueing behind them and no output. Review request logs for structured_outputs with a regex field containing nested quantifiers such as (a+)+, (a*)* or (a|aa)+, especially from one client or key just before the stall.

After the patch, a compile that exceeds the limit fails the request instead of hanging, so errors that name regex compilation and a timeout point to the same abuse. Block or rate-limit the client.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

The structured_outputs.regex API parameter passes a user-supplied regex string directly to grammar compiler backends with no compilation timeout. In the xgrammar backend, the string reaches compile_regex() with no guard. In the outlines backend, validate_regex_is_buildable() blocks structural issues (lookarounds, backreferences) but provides zero protection against exponential DFA state-space explosion. Patterns like (a+)+b pass all checks and hang the inference worker.

Root Cause

backend_xgrammar.py:91 — no timeout:

ctx = self.compiler.compile_regex(grammar_spec)

backend_outlines.py:299–330 — structural checks only, no complexity analysis:

def validate_regex_is_buildable(regex: str) -> None:
    sre_parse.parse(regex)   # AST parse only — does not detect exponential patterns
    _check_unsupported(...)  # blocks lookarounds/backrefs, not nested quantifiers

backend_outlines.py:64 — no timeout:

oc.Index(regex_string, vocabulary.inner)

Impact

Denial of service — one request with an adversarial regex pattern hangs an inference worker indefinitely.

Remediation

Wrap compile_regex() and oc.Index() calls in a thread with a deadline (e.g., 5 seconds). Add complexity analysis to validate_regex_is_buildable() to detect nested quantifier patterns before compilation.

Credited to brodmart, jperezdealgaba.

Questions

Does this need authentication?

The CVSS vector lists no privileges required. If your vLLM API is reachable without a key, anyone can send the request. With keys, any holder of a key can.

Which backends are involved?

Both the xgrammar and outlines structured-output backends. xgrammar calls compile_regex() with no guard, and outlines checks structure only and builds with oc.Index() with no timeout.

How does 0.24.0 stop it?

Compilation runs in a thread with a deadline, 5 seconds by default. VLLM_REGEX_COMPILATION_TIMEOUT_S changes it, and setting it to 0 disables the timeout.

Is it a code execution risk?

No. The advisory describes denial of service only: one request can hang an inference worker.

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