{"id":"CVE-2025-48887","aliases":["CVE-2025-48887","GHSA-w6q7-j642-7c25","PYSEC-2025-50"],"related":[],"kind":"vulnerability","state":"published","title":"vLLM has a Regular Expression Denial of Service (ReDoS, Exponential Complexity) Vulnerability in `pythonic_tool_parser.py`","summary":"vLLM, an inference and serving engine for large language models (LLMs), has a Regular Expression Denial of Service (ReDoS) vulnerability in the file `vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py` of versions 0.6.4 up to but excluding 0.9.0. 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. The pattern contains multiple nested quantifiers, optional groups, and inner repetitions which make it vulnerable to catastrophic backtracking. Version 0.9.0 contains a patch for the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"vLLM, an inference and serving engine for large language models (LLMs), has a Regular Expression Denial of Service (ReDoS) vulnerability in the file `vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py` of versions 0.6.4 up to but excluding 0.9.0. 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. The pattern contains multiple nested quantifiers, optional groups, and inner repetitions which make it vulnerable to catastrophic backtracking. Version 0.9.0 contains a patch for the issue.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nA Regular Expression Denial of Service (ReDoS) vulnerability exists in the file [`vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py`](https://github.com/vllm-project/vllm/blob/main/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.\n\n## Details\n\nThe following regular expression is used to match tool/function call patterns:\n```\nr\"\\[([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*)+\\]\"\n```\nThis pattern contains multiple nested quantifiers (`*`, `+`), optional groups, and inner repetitions which make it vulnerable to catastrophic backtracking.\n\n**Attack Example:**\nA malicious input such as  \n```\n[A(A=\t)A(A=,\t\t)A(A=,\t\t)A(A=,\t\t)... (repeated dozens of times) ...]\n\nor\n\n\"[A(A=\" + \"\\t)A(A=,\\t\" * repeat\n```\n\n\n\ncan cause the regular expression engine to consume CPU exponentially with the input length, effectively freezing or crashing the server (DoS).\n\n**Proof of Concept:**\nA 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.\n\n```\nLength: 22, Time: 0.0000 seconds, Match: False\nLength: 38, Time: 0.0010 seconds, Match: False\nLength: 54, Time: 0.0250 seconds, Match: False\nLength: 70, Time: 0.5185 seconds, Match: False\nLength: 86, Time: 13.2703 seconds, Match: False\nLength: 102, Time: 319.0717 seconds, Match: False\n```\n\n## Impact\n\n- **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.\n- **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.\n- **Potential for Broader System Instability:** Resource exhaustion from stuck or slow requests may cascade into broader system instability or service downtime if not mitigated.\n\n## Fix\n\n* https://github.com/vllm-project/vllm/pull/18454\n* 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).","format":"markdown","source":"ghsa"},{"lang":"es","text":"vLLM, un motor de inferencia y servicio para modelos de lenguaje grandes (LLM), presenta una vulnerabilidad de denegación de servicio por expresión regular (ReDoS) en el archivo `vllm/entrypoints/openai/tool_parsers/pythonic_tool_parser.py` de las versiones 0.6.4 a 0.9.0, excepto esta última. La causa principal es el uso de una expresión regular anidada y altamente compleja para la detección de llamadas a herramientas, que un atacante puede explotar para causar una degradación grave del rendimiento o inhabilitar el servicio. El patrón contiene múltiples cuantificadores anidados, grupos opcionales y repeticiones internas, lo que lo hace vulnerable a un retroceso catastrófico. La versión 0.9.0 incluye un parche para este problema.","source":"nvd"}],"published":"2025-05-28T17:49:33.000Z","modified":"2026-08-07T08:12:04.723Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"version":">= 0.6.4, < 0.9.0","status":"affected"}],"vendor":"vllm-project","product":"vllm","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.6.4","status":"affected","fixed":"0.9.0"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"0.6.4","fixed":"0.9.0"}],"vendor":"vllm","product":"vllm","cpe":"cpe:2.3:a:vllm:vllm:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"4fc1bf813ad80172c1db31264beaef7d93fe0601"},{"type":"ecosystem","introduced":"0.6.4","status":"affected","fixed":"0.9.0"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","repo":"https://github.com/vllm-project/vllm","source":"pysec"}],"references":[{"url":"https://github.com/vllm-project/vllm/security/advisories/GHSA-w6q7-j642-7c25","tags":["advisory","evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vllm-project/vllm/pull/18454","tags":["fix","issue-tracking","patch","report","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vllm-project/vllm/commit/4fc1bf813ad80172c1db31264beaef7d93fe0601","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-48887","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/vllm/PYSEC-2025-50.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vllm-project/vllm","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-w6q7-j642-7c25","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-05-30T17:58:00.784Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-48887","url":"https://www.cve.org/CVERecord?id=CVE-2025-48887","licence":"CVE Terms of Use","modified":"2025-05-30T17:58:23.074Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w6q7-j642-7c25","url":"https://github.com/advisories/GHSA-w6q7-j642-7c25","licence":"CC-BY-4.0","modified":"2026-08-07T08:12:04.723Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-48887","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-48887","licence":"Public domain","modified":"2026-06-17T09:30:26.173Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2025-50","url":"https://osv.dev/vulnerability/PYSEC-2025-50","licence":"CC-BY-4.0","modified":"2026-06-10T17:14:19.371Z"}],"updatedAt":"2026-11-25T22:58:58.601Z","epss":{"score":0.0055,"percentile":0.4743,"date":"2026-12-01T12:00:22.000Z"}}