[Frontend] Enforce tokenize=False when applying chat template#27205
[Frontend] Enforce tokenize=False when applying chat template#27205DarkLight1337 merged 4 commits intomainfrom
Conversation
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
|
previously reviewed and approved by @DarkLight1337 |
There was a problem hiding this comment.
Code Review
This pull request addresses a critical security vulnerability (GHSA-69j4-grxj-j64p) related to arbitrary code execution via chat templates. The changes effectively mitigate this risk by enforcing tokenize=False when applying HuggingFace chat templates and by rejecting tokenize and chat_template parameters within chat_template_kwargs. This prevents the vulnerable code path in the transformers library from being executed. The implementation is clean, and the accompanying tests correctly verify the new security constraints. The changes are well-targeted and appear to be a solid fix for the reported vulnerability.
|
@russellb if you care for executing AMD tests (https://buildkite.com/vllm/amd-ci/builds/410), please rebase your feature branch to any commit after introduction of the file test-amd.yaml (#26852). |
…roject#27205) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
…roject#27205) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
…roject#27205) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
…roject#27205) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
…roject#27205) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
…roject#27205) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
…roject#27205) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
…roject/vllm#27205) Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn> Co-authored-by: Isotr0py <mozf@mail2.sysu.edu.cn>
- vllm-project/vllm#25896 - vllm-project/vllm#27205 - vllm-project/vllm#27204 - vllm-project/vllm#27431 - chat_utils: fix resolve_chat_template_kwargs duplication - vllm-project/vllm#27556 - vllm-project/vllm#25996 - requirements/rocm.txt: pin triton==3.3.0 (from build requirements) - Dockerfile*.ubi: bump base image tag to 9.6-1760340988 - Dockerfile*.ubi: pre-download tiktoken tokenizers (o200k_base) (https://issues.redhat.com/browse/INFERENG-2959) - Dockerfile.ubi: add missing `cuda-cudart-devel` package, required for deepgeemm JITs - vllm-project/vllm#25999 - vllm-project/vllm#26416 Related: neuralmagic/nm-cicd#313
GHSA-69j4-grxj-j64p