mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Uploaded files reaching the RAG ingest path were trusted by client filename and content-type, so archives and executable scripts were ingested and malicious content was never screened. Enforce controls at the upload boundary before the file leaves the proxy: - classify content by magic bytes and a strict UTF-8 decode, never by the client filename or content-type - allowlist PDF and UTF-8 text; reject archives and executables/scripts - cap upload size (512MB) via a bounded read - run every accepted upload through a dependency-injected malware scanner, failing closed on scan error; the default scanner flags the EICAR test file so the hook is validated end to end - give accepted uploads a server-generated filename so the client name never reaches storage - set Content-Disposition attachment and X-Content-Type-Options nosniff on vector-store file downloads |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_rag_endpoints.py | ||
| test_upload_security.py | ||