fix(security): enforce VLLM_MAX_AUDIO_CLIP_FILESIZE_MB on all audio paths (#53561)

Signed-off-by: jperezde <jperezde@redhat.com>
This commit is contained in:
Juan Pérez de Algaba
2026-08-24 21:37:02 +00:00
committed by GitHub
parent 23ab0cfdbc
commit 0d7d5ed0b2
4 changed files with 27 additions and 5 deletions
+4 -3
View File
@@ -987,9 +987,10 @@ environment_variables: dict[str, Callable[[], Any]] = {
"VLLM_MEDIA_LOADING_THREAD_COUNT": lambda: int(
os.getenv("VLLM_MEDIA_LOADING_THREAD_COUNT", "8")
),
# Maximum filesize in MB for a single audio file when processing
# speech-to-text requests. Files larger than this will be rejected.
# Default is 25 MB
# Maximum filesize in MB for a single audio file. Enforced on all
# audio inputs (multimodal chat, speech-to-text uploads, data: URLs,
# and local file:// paths). Files larger than this will be rejected
# before decoding. Default is 25 MB.
"VLLM_MAX_AUDIO_CLIP_FILESIZE_MB": lambda: int(
os.getenv("VLLM_MAX_AUDIO_CLIP_FILESIZE_MB", "25")
),
+1
View File
@@ -312,6 +312,7 @@ class AudioMediaIO(MediaIO[tuple[npt.NDArray, float]]):
return self.load_bytes(pybase64.b64decode(data))
def load_file(self, filepath: Path) -> tuple[npt.NDArray, float]:
self._validate_encoded_size(filepath.stat().st_size)
return load_audio(
filepath,
sr=None,