6.5medium
vLLM: Out-of-vocabulary prompt token id passes input validation and triggers a CUDA device-side assert (engine crash / DoS)
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.43% (higher than 39% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-q97c-p368-75c4PYSEC-2026-4347
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| vllm-project vllm | < 0.32.0 | CVE List |
| vllm (PyPI) | before 0.32.0 | GitHub Advisory Database, PyPA Advisory Database |
| vllm vllm | before 0.32.0 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
Root cause
vllm/v1/engine/input_processor.py accepts a token id when id <= max(tokenizer.max_token_id, model_config.get_vocab_size() - 1).
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.
The engine bound therefore becomes max(32000, 31999) = 32000, and id 32000 is accepted.
The 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.
Affected
- 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. - Models whose vocab is a multiple of 64 with
tokenizer.vocab_sizeone past the max real id (Llama-2 family, vocab 32000, is the clear case). Qwen2.5 is NOT affected (padded headroom).
Suggested fix
max_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, released in v0.32.0.
Reporter
Shijie Lyu (GitHub shijie-lyu lshjhf@gmail.com). Reported privately per SECURITY.
This advisory was fixed in MR59491.
References
| https://github.com/vllm-project/vllm/security/advisories/GHSA-q97c-p368-75c4 | fix, patch, vendor-advisory, web | |
| https://github.com/vllm-project/vllm/pull/59491 | fix, patch, web | |
| https://github.com/vllm-project/vllm/commit/37cecc8141e2dcba9dd534897a164d4baaf27229 | fix, patch, web | |
| https://github.com/vllm-project/vllm/releases/tag/v0.32.0 | advisory, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-115916 | advisory | |
| https://github.com/vllm-project/vllm | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-115916 changed 2026-11-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-q97c-p368-75c4 changed 2026-10-29 | CC-BY-4.0 |
| NVD | CVE-2026-115916 changed 2026-11-02 | Public domain |
| PyPA Advisory Database | PYSEC-2026-4347 changed 2026-10-29 | CC-BY-4.0 |