(security) Enforce audio upload size limit before full file materialization (#45510)

Signed-off-by: jperezde <jperezde@redhat.com>
This commit is contained in:
Juan Pérez de Algaba
2026-06-15 10:25:24 +00:00
committed by GitHub
parent 6c5872efc5
commit b997071ec4
4 changed files with 210 additions and 2 deletions
@@ -13,6 +13,7 @@ from vllm.entrypoints.serve.utils.api_utils import (
load_aware_call,
with_cancellation,
)
from vllm.entrypoints.speech_to_text.base.utils import read_upload_with_limit
from vllm.logger import init_logger
from .protocol import TranslationRequest, TranslationResponseVariant
@@ -45,7 +46,7 @@ async def create_translations(
if handler is None:
raise NotImplementedError("The model does not support Translations API")
audio_data = await request.file.read()
audio_data = await read_upload_with_limit(request.file)
generator = await handler.create_translation(audio_data, request, raw_request)