{"id":"CVE-2025-46560","aliases":["CVE-2025-46560","GHSA-vc6m-hm49-g9qg","PYSEC-2026-2022"],"related":[],"kind":"vulnerability","state":"published","title":"vLLM phi4mm: Quadratic Time Complexity in Input Token Processing​ leads to denial of service","summary":"vLLM is a high-throughput and memory-efficient inference and serving engine for LLMs. Versions starting from 0.8.0 and prior to 0.8.5 are affected by a critical performance vulnerability in the input preprocessing logic of the multimodal tokenizer. The code dynamically replaces placeholder tokens (e.g., <|audio_|>, <|image_|>) with repeated tokens based on precomputed lengths. Due to ​​inefficient list concatenation operations​​, the algorithm exhibits ​​quadratic time complexity (O(n²))​​, allowing malicious actors to trigger resource exhaustion via specially crafted inputs. This issue has been patched in version 0.8.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"vLLM is a high-throughput and memory-efficient inference and serving engine for LLMs. Versions starting from 0.8.0 and prior to 0.8.5 are affected by a critical performance vulnerability in the input preprocessing logic of the multimodal tokenizer. The code dynamically replaces placeholder tokens (e.g., <|audio_|>, <|image_|>) with repeated tokens based on precomputed lengths. Due to ​​inefficient list concatenation operations​​, the algorithm exhibits ​​quadratic time complexity (O(n²))​​, allowing malicious actors to trigger resource exhaustion via specially crafted inputs. This issue has been patched in version 0.8.5.","source":"cvelist"},{"lang":"en","text":"### Summary\nA critical performance vulnerability has been identified in the input preprocessing logic of the multimodal tokenizer. The code dynamically replaces placeholder tokens (e.g., <|audio_*|>, <|image_*|>) with repeated tokens based on precomputed lengths. Due to ​​inefficient list concatenation operations​​, the algorithm exhibits ​​quadratic time complexity (O(n²))​​, allowing malicious actors to trigger resource exhaustion via specially crafted inputs.\n\n### Details\n​​Affected Component​​: input_processor_for_phi4mm function.\nhttps://github.com/vllm-project/vllm/blob/8cac35ba435906fb7eb07e44fe1a8c26e8744f4e/vllm/model_executor/models/phi4mm.py#L1182-L1197\n\nThe code modifies the input_ids list in-place using input_ids = input_ids[:i] + tokens + input_ids[i+1:]. Each concatenation operation copies the entire list, leading to O(n) operations per replacement. For k placeholders expanding to m tokens, total time becomes O(kmn), approximating O(n²) in worst-case scenarios.\n\n### PoC\nTest data demonstrates exponential time growth:\n```python\ntest_cases = [100, 200, 400, 800, 1600, 3200, 6400]\nrun_times = [0.002, 0.007, 0.028, 0.136, 0.616, 2.707, 11.854]  # seconds\n```\nDoubling input size increases runtime by ~4x (consistent with O(n²)).\n\n### Impact\n​​Denial-of-Service (DoS):​​ An attacker could submit inputs with many placeholders (e.g., 10,000 <|audio_1|> tokens), causing CPU/memory exhaustion.\nExample: 10,000 placeholders → ~100 million operations.\n\n\n### Remediation Recommendations​\nPrecompute all placeholder positions and expansion lengths upfront.\nReplace dynamic list concatenation with a single preallocated array.\n```python\n# Pseudocode for O(n) solution\nnew_input_ids = []\nfor token in input_ids:\n    if token is placeholder:\n        new_input_ids.extend([token] * precomputed_length)\n    else:\n        new_input_ids.append(token)\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"vLLM es un motor de inferencia y servicio de alto rendimiento y eficiente en memoria para LLM. Las versiones a partir de la 0.8.0 y anteriores a la 0.8.5 se ven afectadas por una vulnerabilidad crítica de rendimiento en la lógica de preprocesamiento de entrada del tokenizador multimodal. El código reemplaza dinámicamente los tokens de marcador de posición (p. ej., &lt;|audio_|&gt;, &lt;|image_|&gt;) con tokens repetidos basados ??en longitudes precalculadas. Debido a las ineficientes operaciones de concatenación de listas, el algoritmo presenta una complejidad temporal cuadrática (O(n²)), lo que permite a los actores maliciosos activar el agotamiento de recursos mediante entradas especialmente manipuladas. Este problema se ha corregido en la versión 0.8.5.","source":"nvd"}],"published":"2025-04-29T16:43:10.000Z","modified":"2026-08-07T08:12:13.536Z","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"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","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.8.0, < 0.8.5","status":"affected"}],"vendor":"vllm-project","product":"vllm","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.8.0","status":"affected","fixed":"0.8.5"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"0.8.0","fixed":"0.8.5"}],"vendor":"vllm","product":"vllm","cpe":"cpe:2.3:a:vllm:vllm:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0.8.0","status":"affected","fixed":"0.8.5"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","source":"pysec"}],"references":[{"url":"https://github.com/vllm-project/vllm/security/advisories/GHSA-vc6m-hm49-g9qg","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vllm-project/vllm/blob/8cac35ba435906fb7eb07e44fe1a8c26e8744f4e/vllm/model_executor/models/phi4mm.py#L1182-L1197","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46560","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/advisories/GHSA-vc6m-hm49-g9qg","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/vllm/PYSEC-2026-2022.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vllm-project/vllm","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/vllm","tags":["package","web"],"sources":["ghsa","pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-30T13:09:10.349Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-46560","url":"https://www.cve.org/CVERecord?id=CVE-2025-46560","licence":"CVE Terms of Use","modified":"2025-04-30T13:09:13.422Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vc6m-hm49-g9qg","url":"https://github.com/advisories/GHSA-vc6m-hm49-g9qg","licence":"CC-BY-4.0","modified":"2026-08-07T08:12:13.536Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-46560","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-46560","licence":"Public domain","modified":"2026-06-17T09:26:37.837Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2022","url":"https://osv.dev/vulnerability/PYSEC-2026-2022","licence":"CC-BY-4.0","modified":"2026-07-07T17:48:17.648Z"}],"updatedAt":"2026-11-25T22:58:57.140Z","epss":{"score":0.00543,"percentile":0.47046,"date":"2026-12-01T12:00:22.000Z"}}