[Security] Fix remote DoS from grammar-rejected spec tokens padded with -1#44743
Open
jperezdealgaba wants to merge 1 commit into
vllm-project:mainvllm-project/vllm:mainfrom
jperezdealgaba:fix/dos-grammar-rejected-spec-tokensjperezdealgaba/vllm:fix/dos-grammar-rejected-spec-tokensCopy head branch name to clipboard
Open
[Security] Fix remote DoS from grammar-rejected spec tokens padded with -1#44743jperezdealgaba wants to merge 1 commit intovllm-project:mainvllm-project/vllm:mainfrom jperezdealgaba:fix/dos-grammar-rejected-spec-tokensjperezdealgaba/vllm:fix/dos-grammar-rejected-spec-tokensCopy head branch name to clipboard
jperezdealgaba wants to merge 1 commit into
vllm-project:mainvllm-project/vllm:mainfrom
jperezdealgaba:fix/dos-grammar-rejected-spec-tokensjperezdealgaba/vllm:fix/dos-grammar-rejected-spec-tokensCopy head branch name to clipboard
Conversation
When structured output invalidates speculative draft slots, the scheduler pads them with -1 for bitmask layout. Cap accepted tokens to the grammar-valid prefix in update_from_output, and sanitize -1 before writing spec tokens to token_ids_cpu so invalid IDs cannot reach GPU embeddings. Add regression tests Signed-off-by: Juan Pérez de Algaba <jperezde@redhat.com> Signed-off-by: jperezde <jperezde@redhat.com>
38b136a to
75507c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes https://github.com/vllm-project/vllm/security/advisories/GHSA-55m4-88pw-2875
When structured output invalidates speculative draft slots, the scheduler pads them with -1 for bitmask layout. This allows invalid token IDs (-1) to reach GPU embeddings, causing a remote denial of service.
Fix:
update_from_outputtoken_ids_cpuso invalid IDs cannot reach GPU embeddingsTest plan
tests/v1/core/test_ghsa_invalid_spec_tokens.pytests/v1/worker/test_gpu_input_batch.pyNotes
Made with Cursor