@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 3d20275bb4
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

fix(security): enforce audio decode duration limit in chat completions path (#45908)

Signed-off-by: jperezde <jperezde@redhat.com>

Juan Pérez de Algaba committed Jun 17, 2026 at 13:07 UTC 3d20275bb4d434f53055c3c0b645fd8bb072965e
1 file changed +11 -2
vllm/multimodal/media/audio.py
+11 -2
@@ -9,6 +9,7 @@ import numpy.typing as npt
9 import pybase64
10 import torch
11
12 +import vllm.envs as envs
13 from vllm.logger import init_logger
14 from vllm.multimodal.audio import resample_audio_pyav
15 from vllm.utils.import_utils import PlaceholderModule
@@ -235,7 +236,11 @@ class AudioMediaIO(MediaIO[tuple[npt.NDArray, float]]):
236 self.kwargs = kwargs
237
238 def load_bytes(self, data: bytes) -> tuple[npt.NDArray, float]:
238 - return load_audio(BytesIO(data), sr=None)
239 + return load_audio(
240 + BytesIO(data),
241 + sr=None,
242 + max_duration_s=envs.VLLM_MAX_AUDIO_DECODE_DURATION_S,
243 + )
244
245 def load_base64(
246 self,
@@ -245,7 +250,11 @@ class AudioMediaIO(MediaIO[tuple[npt.NDArray, float]]):
250 return self.load_bytes(pybase64.b64decode(data))
251
252 def load_file(self, filepath: Path) -> tuple[npt.NDArray, float]:
248 - return load_audio(filepath, sr=None)
253 + return load_audio(
254 + filepath,
255 + sr=None,
256 + max_duration_s=envs.VLLM_MAX_AUDIO_DECODE_DURATION_S,
257 + )
258
259 def encode_base64(
260 self,