[Bugfix] Bound cache_salt length to prevent DoS via scheduler CPU exhaustion (#54353)

Signed-off-by: jperezde <jperezde@redhat.com>
This commit is contained in:
Juan Pérez de Algaba
2026-08-30 04:28:16 +00:00
committed by GitHub
parent 1ebff996a1
commit 1dc464d426
6 changed files with 7 additions and 0 deletions
+1
View File
@@ -141,6 +141,7 @@ class AnthropicMessagesRequest(BaseModel):
cache_salt: str | None = Field(
default=None,
min_length=1,
max_length=1024,
description=(
"If specified, the prefix cache will be salted with the provided "
"string to prevent an attacker to guess prompts in multi-user "
@@ -467,6 +467,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
cache_salt: str | None = Field(
default=None,
min_length=1,
max_length=1024,
description=(
"If specified, the prefix cache will be salted with the provided "
"string to prevent an attacker to guess prompts in multi-user "
@@ -199,6 +199,7 @@ class CompletionRequest(OpenAIBaseModel):
cache_salt: str | None = Field(
default=None,
min_length=1,
max_length=1024,
description=(
"If specified, the prefix cache will be salted with the provided "
"string to prevent an attacker to guess prompts in multi-user "
@@ -252,6 +252,7 @@ class ResponsesRequest(OpenAIBaseModel):
cache_salt: str | None = Field(
default=None,
min_length=1,
max_length=1024,
description=(
"If specified, the prefix cache will be salted with the provided "
"string to prevent an attacker to guess prompts in multi-user "
@@ -82,6 +82,8 @@ class PoolingBasicRequestMixin(OpenAIBaseModel):
)
cache_salt: str | None = Field(
default=None,
min_length=1,
max_length=1024,
description=(
"If specified, the prefix cache will be salted with the provided "
"string to prevent an attacker to guess prompts in multi-user "
@@ -124,6 +124,7 @@ class GenerateRequest(BaseModel):
cache_salt: str | None = Field(
default=None,
min_length=1,
max_length=1024,
description=(
"If specified, the prefix cache will be salted with the provided "
"string to prevent an attacker to guess prompts in multi-user "