GHSA-w6q7-j642-7c25: vLLM has a Regular Expression Denial of Service (ReDoS, Exponential Complexity) Vulnerability in `pythonic_tool_parser.py`
6.5
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
vllm | pip | >= 0.6.4, < 0.9.0 | 0.9.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability is a Regular Expression Denial of Service (ReDoS) located in vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py
. The root cause is a specific complex regular expression, TOOL_CALL_PATTERN
, used for parsing tool calls. This pattern, when processed by the standard Python re
module, can lead to catastrophic backtracking with certain inputs, causing excessive CPU usage and service denial.
The identified vulnerable function, vllm.entrypoints.openai.tool_parsers.pythonic_tool_parser.PythonicToolParser.parse_tool_calls
, directly employs this vulnerable regex. The provided patch (commit 4fc1bf813ad80172c1db31264beaef7d93fe0601
) mitigates this by replacing the standard re
library with the regex
library in pythonic_tool_parser.py
(and other files for broader safety). The regex
library is designed to handle such complex patterns more efficiently and avoid ReDoS. Therefore, any runtime profile during the exploitation of this specific ReDoS vulnerability would show PythonicToolParser.parse_tool_calls
as a key function consuming resources due to the regex matching process.