[Security] Validate cache salts before they reach LMCache (#51444)

Signed-off-by: Clinton Thomas <1033162+KernelClint@users.noreply.github.com>
Co-authored-by: Lucas Bourtoule <35483370+dhalf@users.noreply.github.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
Clinton Thomas
2026-09-05 03:56:06 +00:00
committed by GitHub
co-authored by Lucas Bourtoule Cyrus Leung
parent 4ee2595512
commit e962733e08
8 changed files with 101 additions and 3 deletions
@@ -11,6 +11,7 @@ import pytest
from pydantic import ValidationError
from vllm.entrypoints.openai.chat_completion.protocol import ChatCompletionRequest
from vllm.exceptions import VLLMValidationError
@pytest.mark.parametrize(
@@ -28,7 +29,7 @@ def test_chat_completion_request_rejects_non_object_body(payload):
def test_chat_completion_request_cache_salt_still_validated_on_dict():
with pytest.raises(ValidationError, match="cache_salt"):
with pytest.raises(VLLMValidationError, match="cache_salt"):
ChatCompletionRequest.model_validate(
{
"model": "qwen",