CVE-2025-48887
Executive Summary
CVE-2025-48887 is a Regular Expression Denial of Service (ReDoS) vulnerability affecting vLLM, an inference and serving engine for large language models (LLMs). The vulnerability resides in the pythonic_tool_parser.py file, specifically in the regular expression used for tool call detection. The pattern contains multiple nested quantifiers, optional groups, and inner repetitions, making it susceptible to catastrophic backtracking. An attacker can exploit this by sending a crafted input that causes the regex engine to consume excessive CPU resources, leading to severe performance degradation or complete service unavailability. The vulnerability affects versions 0.6.4 up to but excluding 0.9.0. Version 0.9.0 contains a patch that fixes the issue.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the vLLM Python package, which is distributed via PyPI. Users should ensure they are using a patched version (>= 0.9.0) to mitigate the risk. The package is widely used in AI/ML deployments, and exploitation could lead to denial of service in critical inference pipelines.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): None (N)
- User Interaction (UI): None (N)
- Scope (S): Unchanged (U)
- Confidentiality (C): None (N)
- Integrity (I): None (N)
- Availability (A): High (H)
Threat Level: Medium. The vulnerability is remotely exploitable without authentication, but it only affects availability, not confidentiality or integrity. The EPSS score of 0.0% suggests low exploitation likelihood at this time, but the potential for service disruption makes it a significant concern for production environments.
Deep Dive & Mechanics
The vulnerability is a classic ReDoS (Regular Expression Denial of Service) caused by a poorly constructed regex pattern. The pattern in pythonic_tool_parser.py is designed to detect tool calls in LLM output. It contains nested quantifiers (e.g., (a+)+) and optional groups that can cause catastrophic backtracking when processing a specially crafted input string.
Root Cause: The regex pattern uses multiple nested quantifiers and optional groups. For example, a pattern like (a+)+b can cause exponential backtracking when the input string does not match the expected pattern (e.g., a long string of 'a's without a trailing 'b'). The regex engine tries all possible ways to split the 'a's between the inner and outer quantifiers, leading to an exponential increase in processing time.
Exploitation Scenario: An attacker sends a crafted HTTP request to the vLLM API endpoint that triggers the tool parser. The request contains a malicious input string designed to cause catastrophic backtracking. The server's CPU usage spikes, potentially leading to a denial of service for legitimate users.
Vulnerable vs. Patched Code
Vulnerable Code (v0.6.4 - v0.8.x):
The vulnerable regex pattern in vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py contains nested quantifiers and optional groups. The exact pattern is not publicly disclosed, but it is known to be highly complex.
Patched Code (v0.9.0): The patch replaces the vulnerable regex with a more efficient pattern that avoids catastrophic backtracking. The new pattern uses atomic groups or possessive quantifiers to prevent backtracking, or it may use a different parsing approach altogether.
Example of a vulnerable pattern (conceptual):
# Vulnerable pattern (conceptual)
pattern = r"((?:[a-z]+)+)tool_call"
Example of a patched pattern (conceptual):
# Patched pattern (conceptual) using atomic group
pattern = r"(?>[a-z]+)tool_call"
Exploitation & Lab Setup
Red Team
Prerequisites:
- A vulnerable vLLM instance (version 0.6.4 to 0.8.x) with the OpenAI-compatible API endpoint enabled.
- Knowledge of the API endpoint that triggers the tool parser (e.g.,
/v1/chat/completionswith tool calls).
Exploitation Steps:
- Identify the target vLLM endpoint.
- Craft a malicious request that includes a tool call with a specially crafted input string designed to cause catastrophic backtracking.
- Send the request repeatedly to amplify the denial of service effect.
Example Payload (conceptual):
import requests
import time
url = "http://target:8000/v1/chat/completions"
payload = {
"model": "default",
"messages": [
{"role": "user", "content": "A" * 10000 + "!"}
],
"tools": [
{
"type": "function",
"function": {
"name": "test",
"parameters": {"type": "object", "properties": {}}
}
}
]
}
# Send multiple requests to amplify DoS
for i in range(100):
try:
requests.post(url, json=payload, timeout=5)
except:
pass
time.sleep(0.1)
Note: The exact payload depends on the vulnerable regex pattern. The attacker would need to reverse-engineer the pattern or use a fuzzing approach to find a string that triggers catastrophic backtracking.
Blue Team
Detection:
- Monitor CPU usage on vLLM servers for sudden spikes.
- Look for HTTP requests with unusually long input strings in the tool call parameters.
- Use the detection rules provided in the Detection Engineering section.
Mitigation:
- Immediately upgrade to vLLM version 0.9.0 or later.
- If upgrade is not possible, implement a Web Application Firewall (WAF) rule to block requests with excessively long input strings.
- Rate-limit API requests to reduce the impact of a potential DoS attack.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP POST requests to
/v1/chat/completionswith unusually longcontentfields (e.g., > 10,000 characters). - High CPU usage on vLLM servers correlating with API requests.
- HTTP POST requests to
- Log IOCs:
- Repeated timeout errors in vLLM logs.
- Slow response times for API requests.
- File IOCs:
- No specific file-based IOCs.
Detection Engineering
YARA Rule
rule CVE_2025_48887_ReDoS_vLLM {
meta:
description = "Detects potential ReDoS exploitation attempts against vLLM pythonic_tool_parser"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-48887"
strings:
$suspicious_pattern = /[a-zA-Z]{100,}/
condition:
$suspicious_pattern and filesize < 10KB
}
Sigma Rule
title: CVE-2025-48887 vLLM ReDoS Exploitation Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects HTTP requests with unusually long input strings targeting vLLM API endpoints
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: vllm
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/v1/chat/completions'
cs-content-length: '>= 10000'
condition: selection
falsepositives:
- Legitimate large inputs from users
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-48887 vLLM ReDoS Exploitation Attempt"; flow:to_server; content:"POST"; http_method; content:"/v1/chat/completions"; http_uri; content:"Content-Length|3a|"; http_header_names; pcre:"/Content-Length:\s*[0-9]{5,}/"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade vLLM: Upgrade to version 0.9.0 or later, which contains the patch for this vulnerability.
- Apply WAF Rules: Implement Web Application Firewall rules to block requests with excessively long input strings (e.g., > 10,000 characters).
- Rate Limiting: Implement rate limiting on API endpoints to reduce the impact of a potential DoS attack.
Long-term Actions:
- Code Review: Conduct a thorough code review of all regular expressions in the codebase to identify and fix potential ReDoS vulnerabilities.
- Input Validation: Implement strict input validation and length limits for all user-supplied data.
- Monitoring: Set up monitoring and alerting for unusual CPU usage patterns on vLLM servers.
Workarounds:
- If upgrading is not immediately possible, consider disabling the tool parser functionality or using a different tool parser implementation.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert