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-48887 Overview
CVE-2025-48887 is a Regular Expression Denial of Service (ReDoS) vulnerability in vLLM, an inference and serving engine for large language models (LLMs). The flaw resides in vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py and affects versions 0.6.4 up to but excluding 0.9.0. A highly complex and nested regular expression used for tool call detection is vulnerable to catastrophic backtracking. An authenticated attacker can submit crafted input that forces the regex engine into exponential matching behavior, degrading performance or making the inference service unavailable. The issue is tracked under CWE-1333 and was patched in vLLM 0.9.0.
Critical Impact
Authenticated attackers can trigger catastrophic regex backtracking against the OpenAI-compatible tool parsing endpoint, exhausting CPU resources and causing availability loss across the vLLM inference service.
Affected Products
- vLLM versions 0.6.4 through 0.8.x
- vLLM OpenAI-compatible server using the pythonic tool parser
- Any LLM deployment relying on vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py
Discovery Timeline
- 2025-05-30 - CVE-2025-48887 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-48887
Vulnerability Analysis
vLLM exposes an OpenAI-compatible API that supports function and tool calling. The pythonic tool parser uses a Python standard-library re pattern to detect and extract tool call syntax from model outputs and incoming payloads. The pattern contains multiple nested quantifiers, optional groups, and inner repetitions. When fed carefully crafted input, the pattern enters catastrophic backtracking, consuming disproportionate CPU time for each request. Because tool parsing runs synchronously in the request path, a single malicious prompt can block worker threads and starve concurrent inference requests. Attackers only need low-privilege API access to trigger the condition, making the vulnerability practical in multi-tenant or shared-key deployments.
Root Cause
The root cause is the use of Python's built-in re engine against a regex with ambiguous alternations and nested quantifiers. Python's re module does not bound backtracking, so inputs that force the engine to explore many unsuccessful match paths cause exponential execution time. The upstream fix migrates the parser to the third-party regex library, which provides better backtracking behavior and timeout controls.
Attack Vector
Exploitation requires network access to the vLLM OpenAI-compatible endpoint and a valid API credential. An attacker submits a chat completion or tool-call request containing a payload designed to defeat the vulnerable pattern. Each request consumes CPU time well beyond normal inference overhead. Repeated submissions amplify the impact, resulting in denial of service for all tenants served by the same vLLM worker pool.
# Security patch: migrate from standard `re` to the `regex` library
# Source: https://github.com/vllm-project/vllm/commit/4fc1bf813ad80172c1db31264beaef7d93fe0601
# .github/scripts/cleanup_pr_body.sh
python3 - <<EOF
-import re
+import regex as re
with open("${NEW}", "r") as file:
content = file.read()
# benchmarks/benchmark_serving_structured_output.py
# Source: https://github.com/vllm-project/vllm/commit/4fc1bf813ad80172c1db31264beaef7d93fe0601
def evaluate(ret, args):
def _eval_correctness_json(expected, actual):
# extract json string from string using regex
- import re
+ import regex as re
actual = actual.replace("\n", "").replace(" ", "").strip()
try:
Detection Methods for CVE-2025-48887
Indicators of Compromise
- Sustained CPU saturation on vLLM worker processes without a corresponding increase in token throughput.
- API request latencies that spike from milliseconds to multiple seconds for requests invoking tool calling.
- Repeated requests from a single API key containing abnormally long or deeply nested tool-call-like payloads.
- Worker thread stalls or timeouts logged by the vLLM OpenAI entrypoint on pythonic_tool_parser.py.
Detection Strategies
- Instrument the vLLM request path to measure wall-clock time spent inside tool-parser functions and alert on outliers.
- Baseline normal payload sizes for /v1/chat/completions requests and flag requests that exceed thresholds for tool-call content.
- Correlate CPU exhaustion events on inference nodes with API gateway logs to identify the originating credential or source IP.
Monitoring Recommendations
- Export vLLM Prometheus metrics for request latency, queue depth, and CPU utilization, and configure alerts on sustained anomalies.
- Monitor for 5xx responses, dropped connections, or health-check failures on vLLM endpoints as proxies for ReDoS impact.
- Review API key usage patterns to identify low-privilege accounts generating disproportionate CPU load.
How to Mitigate CVE-2025-48887
Immediate Actions Required
- Upgrade vLLM to version 0.9.0 or later where the parser uses the regex library.
- Inventory running vLLM deployments and identify any instance running 0.6.4 through 0.8.x with the OpenAI entrypoint exposed.
- Restrict API access to trusted clients and rotate API keys suspected of abuse.
- Enforce per-key rate limits and request-size limits at an upstream proxy or API gateway.
Patch Information
The fix is delivered in vLLM 0.9.0 via Pull Request #18454 and commit 4fc1bf8. The patch replaces Python's standard re module with the third-party regex library in the pythonic tool parser and related components, mitigating catastrophic backtracking. See the GitHub Security Advisory GHSA-w6q7-j642-7c25 for full details.
Workarounds
- Disable the pythonic tool parser or avoid invoking tool-calling endpoints until the upgrade is applied.
- Place vLLM behind an API gateway that enforces maximum request body size and per-client concurrency limits.
- Terminate requests at the reverse proxy if they exceed a conservative wall-clock timeout (for example, 5–10 seconds for chat completions).
- Isolate tenants onto separate vLLM worker pools so that a single malicious key cannot degrade shared capacity.
# Example: enforce request timeout and body size limits with nginx in front of vLLM
server {
listen 443 ssl;
server_name vllm.example.com;
client_max_body_size 64k;
client_body_timeout 5s;
send_timeout 5s;
location /v1/ {
proxy_pass http://vllm_upstream;
proxy_read_timeout 10s;
proxy_send_timeout 10s;
limit_req zone=per_key burst=10 nodelay;
}
}
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

