You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Security] serve() defaults to an unauthenticated 0.0.0.0 listener; audio/video calibration fetches are unbounded #3970
model.serve() defaults to an open network listener, and audio/video calibration URLs do not get the fetch hardening already added for images. Audited at a16977e.
Findings
1. serve() binds 0.0.0.0 with no authentication and no request limits (Medium, CWE-1188/770)
Defaults:utils/openai_server.py:35 sets DEFAULT_HOST = "0.0.0.0", and models/base.py:3168 defines serve(host="0.0.0.0", port=80, api_key=None). Without a key, /v1/chat/completions is open to the network. The only mitigation is a UserWarning (openai_server.py:424-446).
No request limits:OpenAiRequest (218-226) does not bound max_tokens, n (passed to num_return_sequences when temperature > 0), message size, or body size. One request can pin the GPU or OOM the host.
No Host-header validation: DNS rebinding from a browser can reach a localhost-bound server. The client then appears as loopback, which also permits /shutdown when no key is set.
Fix:
Default to 127.0.0.1, or refuse non-loopback binds without api_key.
Cap max_tokens, n and the body size.
Validate the Host header with TrustedHost middleware.
http(s) audio and video URLs from dataset rows go straight to audioread.ffdec.FFmpegAudioFile.
Any video string goes to av.open(path) (line 35, before the scheme check at line 101) and to librosa.load.
There is no timeout, no byte cap and no redirect limit. ffmpeg/PyAV also accept extra protocols (concat:, subfile:, HLS playlists that reference file://).
An untrusted Hub calibration dataset can hang or exhaust a quantization run, or trigger blind internal requests.
Line 147 calls requests.get with redirects followed and no private or link-local address filtering, which allows blind SSRF to targets such as 169.254.169.254.
Lines 468-476 open arbitrary local paths and file:// URLs without the max_pixels check.
Fix:
Route audio/video fetches through the same bounded worker used for images.
Pass protocol_whitelist to ffmpeg/PyAV.
Apply max_pixels to local images.
Optionally block private and link-local destinations.
Activity
fix(security): bound OpenAI server and media fetches (#3970) (#3980)
fix(audio): probe audioread without an unused import (#3987)