{"id":"CVE-2026-115916","aliases":["CVE-2026-115916","GHSA-q97c-p368-75c4","PYSEC-2026-4347"],"related":[],"kind":"vulnerability","state":"published","title":"vLLM: Out-of-vocabulary prompt token id passes input validation and triggers a CUDA device-side assert (engine crash / DoS)","summary":"vLLM is an inference and serving engine for large language models. Prior to 0.32.0, vllm/tokenizers/hf.py computes max_token_id with an off-by-one upper bound, allowing a pre-tokenized prompt ID equal to the vocabulary size to pass validation. For a tensor-parallel size of one and an exact multiple-of-64 vocabulary, VocabParallelEmbedding.forward does not mask that value before F.embedding uses it, causing a CUDA device-side assertion and terminating the engine. This issue is fixed in version 0.32.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"vLLM is an inference and serving engine for large language models. Prior to 0.32.0, vllm/tokenizers/hf.py computes max_token_id with an off-by-one upper bound, allowing a pre-tokenized prompt ID equal to the vocabulary size to pass validation. For a tensor-parallel size of one and an exact multiple-of-64 vocabulary, VocabParallelEmbedding.forward does not mask that value before F.embedding uses it, causing a CUDA device-side assertion and terminating the engine. This issue is fixed in version 0.32.0.","source":"cvelist"},{"lang":"en","text":"For a model whose vocabulary size is an exact multiple of the embedding padding size (64) — e.g. any Llama-2-family model, vocab 32000 — a single request carrying a pre-tokenized prompt with token id equal to the vocab size (32000) passes vLLM's input-id validation but is one past the last embedding row. At tensor-parallel size 1 the embedding lookup does not mask indices, so the id reaches `F.embedding` out of range and raises a CUDA device-side assert, which poisons the engine's CUDA context and takes the engine down. Any client that can send pre-tokenized input (`/v1/completions` with `prompt` as token ids, `/tokenize`-fed flows, or the `kv_transfer_params[\"prompt_token_ids\"]` reuse path) can trigger it.\n\n## Root cause\n`vllm/v1/engine/input_processor.py` accepts a token id when `id <= max(tokenizer.max_token_id, model_config.get_vocab_size() - 1)`.\n`vllm/tokenizers/hf.py` computes `max_token_id = max(max(vocab.values()), tokenizer.vocab_size)`. For Llama-2 tokenizers `max(vocab.values()) = 31999` but `tokenizer.vocab_size = 32000`, so `max_token_id = 32000` — one greater than the largest valid id.\nThe engine bound therefore becomes `max(32000, 31999) = 32000`, and id 32000 is accepted.\nThe model's embedding has `pad_vocab_size(32000, 64) = 32000` rows (no padding), valid indices 0..31999. At `VocabParallelEmbedding.forward` with `tp_size == 1` there is no masking, so index 32000 hits `F.embedding` out of range.\n\n## Affected\n- tp=1 (single GPU per model — common per-copy layout). tp>1 masks via `get_masked_input_and_mask`, so the id is clamped, not an OOB — likely wrong output rather than a crash.\n- Models whose vocab is a multiple of 64 with `tokenizer.vocab_size` one past the max real id (Llama-2 family, vocab 32000, is the clear case). Qwen2.5 is NOT affected (padded headroom).\n\n## Suggested fix \nmax_token_id in vllm/tokenizers/hf.py now uses tokenizer.vocab_size - 1, so an id equal to the vocabulary size fails input validation instead of reaching the embedding. Fixed in [MR59491](https://github.com/vllm-project/vllm/pull/59491), released in v0.32.0.\n\n## Reporter\nShijie Lyu (GitHub shijie-lyu lshjhf@gmail.com). Reported privately per SECURITY.\n\nThis advisory was fixed in [MR59491](https://github.com/vllm-project/vllm/pull/59491).","format":"markdown","source":"ghsa"}],"published":"2026-10-26T17:18:17.582Z","modified":"2026-11-02T18:18:39.033Z","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":"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-129","CWE-193"],"affected":[{"ranges":[{"version":"< 0.32.0","status":"affected"}],"vendor":"vllm-project","product":"vllm","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.32.0"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.32.0"}],"vendor":"vllm","product":"vllm","cpe":"cpe:2.3:a:vllm:vllm:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.32.0"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","source":"pysec"}],"references":[{"url":"https://github.com/vllm-project/vllm/security/advisories/GHSA-q97c-p368-75c4","tags":["fix","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vllm-project/vllm/pull/59491","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vllm-project/vllm/commit/37cecc8141e2dcba9dd534897a164d4baaf27229","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vllm-project/vllm/releases/tag/v0.32.0","tags":["advisory","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-115916","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vllm-project/vllm","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-02T17:49:45.650Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-115916","url":"https://www.cve.org/CVERecord?id=CVE-2026-115916","licence":"CVE Terms of Use","modified":"2026-11-02T17:50:28.478Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q97c-p368-75c4","url":"https://github.com/advisories/GHSA-q97c-p368-75c4","licence":"CC-BY-4.0","modified":"2026-10-29T11:10:41.396Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-115916","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-115916","licence":"Public domain","modified":"2026-11-02T18:18:39.033Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4347","url":"https://osv.dev/vulnerability/PYSEC-2026-4347","licence":"CC-BY-4.0","modified":"2026-10-29T11:00:02.788Z"}],"updatedAt":"2026-11-25T22:59:47.173Z","epss":{"score":0.00434,"percentile":0.39505,"date":"2026-12-01T12:00:22.000Z"}}