Miggo Logo

GHSA-9hcf-v7m4-6m2j: vLLM allows clients to crash the openai server with invalid regex

6.5

CVSS Score
3.1

Basic Information

CVE ID
-
EPSS Score
-
Published
5/28/2025
Updated
5/28/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
vllmpip>= 0.8.0, < 0.9.00.9.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability (GHSA-9hcf-v7m4-6m2j) describes a denial of service in vLLM where providing an invalid regex during structured output generation could crash the server. The root cause is an unhandled exception originating from the xgrammar library when it attempts to parse or convert a schema derived from the invalid regex.

The primary vulnerable function identified is vllm.v1.structured_output.backend_xgrammar.validate_xgrammar_grammar. This function is called when the guided_decoding_backend is set to xgrammar or auto. Inside this function, a JSON schema (potentially derived from the user's regex input) is processed by xgr.Grammar.from_json_schema(schema). The commit 08bf7840780980c7568c573c70a6a8db94fd45ff shows that a try-except block was added around this specific call. This directly implies that, prior to the patch, exceptions raised by xgr.Grammar.from_json_schema due to malformed input (stemming from an invalid regex) were not caught within validate_xgrammar_grammar. This unhandled exception would then propagate, ultimately crashing the server.

The function vllm.v1.engine.processor._validate_structured_output was also modified to improve the robustness of its fallback mechanism (i.e., to validate grammar for the 'guidance' backend if 'xgrammar' fails). However, the direct cause of the crash, the unhandled exception from xgrammar processing, was addressed by the changes in validate_xgrammar_grammar. Therefore, validate_xgrammar_grammar is the key vLLM function that, due to missing error handling for the underlying library call, allowed the invalid regex to trigger a server crash.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t * **ni*l o* s*rvi** *u* **us** t** vLLM s*rv*r to *r*s* i* *n inv*li* r***x w*s provi*** w*il* usin* stru*tur** output. T*is vuln*r**ility is simil*r to [**S*-*q**-v*r*-**x*](*ttps://*it*u*.*om/vllm-proj**t/vllm/s**urity/**visori*s/**S*-*

Reasoning

T** vuln*r**ility (**S*-****-v*m*-*m*j) **s*ri**s * **ni*l o* s*rvi** in vLLM w**r* provi*in* *n inv*li* r***x *urin* stru*tur** output **n*r*tion *oul* *r*s* t** s*rv*r. T** root **us* is *n un**n*l** *x**ption ori*in*tin* *rom t** `x*r*mm*r` li*r*r