CVE-2025-48887: vLLM has a Regular Expression Denial of Service (ReDoS, Exponential Complexity) Vulnerability in `pythonic_tool_parser.py`
vLLM 0.6.4 up to 0.8.x has a regular-expression denial of service in its pythonic tool-call parser. A low-privileged API user can send a crafted string that makes the regex take minutes, which stalls requests and can exhaust GPU memory. Upgrade to 0.9.0.
Published May 28, 2025 · Updated Jun 19, 2025 · Analysis Nov 10, 2026
What an attacker can do
The file vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py uses one regular expression to detect tool-call patterns. It nests quantifiers, optional groups and repeated .* segments, which gives catastrophic backtracking on crafted input.
The advisory's trigger is a string that looks like a bracketed list of function calls with key=value arguments padded with tabs and commas, starting [A(A=. Timing grew from 0.5 seconds at 70 characters to 13 seconds at 86 and 319 seconds at 102 characters, all for non-matches.
The attacker needs an account on the API (low privileges) and no user interaction. Because the parser runs during function-call handling, stalled requests keep their resources. The advisory says this can delay release of the KV cache in GPU memory, which lowers throughput and can spread into wider instability. It gives no data access or code execution (CVSS 3.1 of 6.5, availability only).
Who is affected
The pip package vllm, versions from 0.6.4 up to but not including 0.9.0, on servers that use the pythonic tool parser. Check:
pip show vllmLook at your serve command for the tool-call parser setting to see whether pythonic is selected.
vllm
- Ecosystem
- PyPI
- Affected
- >= 0.6.4, < 0.9.0
- Fixed in
- 0.9.0
- Check
pip show vllm
How to fix it
Upgrade to 0.9.0 (pull request 18454):
pip install --upgrade vllm==0.9.0The maintainers say the change lowers the regex complexity from exponential to O(N^2) and note it may still be problematic. The advisory lists no workaround. If you cannot upgrade, do not select the pythonic tool parser, and put per-request timeouts in front of the server.
How to tell if you were hit
Look for requests that hang for minutes, a vLLM worker process pinned at high CPU, and a rise in GPU memory held by stalled requests. In request logs, look for inputs that contain long runs of A(A=, with tabs. The advisory names no log line.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
A Regular Expression Denial of Service (ReDoS) vulnerability exists in the file `vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py` of the vLLM project. The root cause is the use of a highly complex and nested regular expression for tool call detection, which can be exploited by an attacker to cause severe performance degradation or make the service unavailable.
Details
The following regular expression is used to match tool/function call patterns:
r"\[([a-zA-Z]+\w*\(([a-zA-Z]+\w*=.*,\s*)*([a-zA-Z]+\w*=.*\s)?\),\s*)*([a-zA-Z]+\w*\(([a-zA-Z]+\w*=.*,\s*)*([a-zA-Z]+\w*=.*\s*)?\)\s*)+\]"This pattern contains multiple nested quantifiers (*, +), optional groups, and inner repetitions which make it vulnerable to catastrophic backtracking.
Attack Example: A malicious input such as
[A(A= )A(A=, )A(A=, )A(A=, )... (repeated dozens of times) ...]
or
"[A(A=" + "\t)A(A=,\t" * repeatcan cause the regular expression engine to consume CPU exponentially with the input length, effectively freezing or crashing the server (DoS).
Proof of Concept: A Python script demonstrates that matching such a crafted string with the above regex results in exponential time complexity. Even moderate input lengths can bring the system to a halt.
Length: 22, Time: 0.0000 seconds, Match: False
Length: 38, Time: 0.0010 seconds, Match: False
Length: 54, Time: 0.0250 seconds, Match: False
Length: 70, Time: 0.5185 seconds, Match: False
Length: 86, Time: 13.2703 seconds, Match: False
Length: 102, Time: 319.0717 seconds, Match: FalseImpact
- Denial of Service (DoS): An attacker can trigger a denial of service by sending specially crafted payloads to any API or interface that invokes this regex, causing excessive CPU usage and making the vLLM service unavailable.
- Resource Exhaustion and Memory Retention: As this regex is invoked during function call parsing, the matching process may hold on to significant CPU and memory resources for extended periods (due to catastrophic backtracking). In the context of vLLM, this also means that the associated KV cache (used for model inference and typically stored in GPU memory) is not released in a timely manner. This can lead to GPU memory exhaustion, degraded throughput, and service instability.
- Potential for Broader System Instability: Resource exhaustion from stuck or slow requests may cascade into broader system instability or service downtime if not mitigated.
Fix
- https://github.com/vllm-project/vllm/pull/18454
- Note that while this change has significantly improved performance, this regex may still be problematic. It has gone from exponential time complexity, O(2^N), to O(N^2).
Credited to kexinoh, russellb, mgoin.
Questions
- Which vLLM versions are affected by CVE-2025-48887?
0.6.4 up to but not including 0.9.0. The fix is 0.9.0.
- Does it need authentication?
The advisory rates privileges required as low, so the attacker needs a way to reach an API that calls the parser. No user interaction is needed.
- Why can it hurt GPU memory?
Stalled requests can delay the release of the KV cache, which sits in GPU memory, lowering throughput.
- Is the fix complete?
The maintainers say complexity fell from exponential to O(N^2) but the expression may still be problematic.
References
Read for this analysis:
- https://github.com/vllm-project/vllm/pull/18454
- https://github.com/vllm-project/vllm/commit/4fc1bf813ad80172c1db31264beaef7d93fe0601
- https://nvd.nist.gov/vuln/detail/CVE-2025-48887
- https://github.com/pypa/advisory-database/tree/main/vulns/vllm/PYSEC-2025-50.yaml
- https://github.com/advisories/GHSA-w6q7-j642-7c25
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 entriesCVE-2026-115911
vLLM: DoS via unbounded chat_template Jinja2 rendering exhausts the renderer thread pool
medium6.5Oct 28, 2026CVE-2026-115912
vLLM: Public multimodal SHM handle forgery reaches worker-side `pickle.loads()` with insecure serialization disabled
high7.5Oct 28, 2026CVE-2026-115913
vLLM: Phi-4 multimodal audio encoder materializes and retains full attention matrices: a single max-length audio OOM-crashes the vLLM engine
medium6.5Oct 28, 2026CVE-2026-115914
vLLM DeepSeek-OCR image processing vulnerable to denial of service
medium6.5Oct 28, 2026CVE-2026-115915
vLLM: Untrusted EPS inputs can trigger denial of service or Ghostscript RCE
high8.1Oct 28, 2026CVE-2026-115916
vLLM: Out-of-vocabulary prompt token id passes input validation and triggers a CUDA device-side assert (engine crash / DoS)
medium6.5Oct 28, 2026
