[Bug] OpenAI API accepts server-local file:// media URLs, exposing local media content through model replies
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend-api-design, security
Línea de trabajo
Start with lmdeploy/vl/media/connection.py, especially load_from_url() and _load_file_url(), then trace how lmdeploy/serve/openai/protocol.py passes chat media URLs into the loader. Check the existing media connection tests and add coverage for file:// URLs and raw local paths. Done means OpenAI requests can no longer expose server-local media through model replies, while supported remote media URLs still work.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Checklist
- 1. I have searched related issues but cannot get the expected help.
- 2. The bug has not been fixed in the latest version.
- 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
Describe the bug
Summary
load_from_url() still accepts file:// URLs and raw local paths. In LMDeploy 0.18.0, an OpenAI chat request caused the server to read a server-local PNG and pass it into the multimodal model. The assistant response contained the exact secret marker embedded in that image (SECRET-7391). This confirms both current-version reachability and a practical content-exposure channel for readable media files. A non-media text file was rejected by the media decoder and returned HTTP 400.
Affected component
lmdeploy/serve/openai/protocol.py:229andlmdeploy/serve/openai/protocol.py:616accept image URLs in chat requests.lmdeploy/vl/media/connection.py:125-137dispatchesfile://URLs and existing local paths to_load_file_url().lmdeploy/vl/media/connection.py:118-122reads the server-local path without an administrator-configured media root or path allowlist.
Impact
An API caller who knows or can guess a readable media path can make the server read that image/audio/video file and may recover its visual or semantic content through the model response. This can expose screenshots, documents scanned as images, saved multimodal uploads, or other server-readable media outside the intended request boundary. The tested proof is limited to media accepted by an enabled decoder; it is not arbitrary non-media file read.
Reproduction
Preconditions
The attacker can submit a chat completion request.
The attacker knows or guesses a server-readable media path.
The file type is accepted by an enabled media decoder and the loaded model can describe or transcribe relevant content.
The service process has permission to read the file.
Tested environment
Target: LMDeploy 0.18.0 Linux cp312 wheel.
Wheel SHA-256:
fcef7cf0d210d766e02e2e6df025378d2f8ae36080400b2818eb9a34ef3392dc.Model:
/mnt/sdb18t/ljp/models/Qwen3.5-0.8B, real LMDeploy OpenAI server, PyTorch backend.GPU: one NVIDIA GPU only.
Host: Ubuntu 22.04, Linux 6.8.0-149-generic, x86_64.
Test date: 2026-12-04 (Asia/Shanghai).
Proof of concept
The PoC generated a local PNG containing the text SECRET-7391, then submitted:
{
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "file:///audit/supplement_20261204/f4/secret_marker.png"
}
},
{
"type": "text",
"text": "Look at the supplied local image. Return only the exact uppercase token shown in the image."
}
]
}
]
}A second request used a local text file containing TEXT-NOT-IMAGE-9012.
Results
Case | Path type | HTTP | Result -- | -- | -- | -- Marker PNG | file://.../secret_marker.png | 200 | Assistant returned exactly SECRET-7391; request had 320 prompt tokens Text file | file://.../not_media.txt | 400 | Generic preprocessing failure from the media decoderRelated public discussion
Earlier public issue/PR discussion has touched on file:// handling:
Related PR referenced in that discussion: https://github.com/InternLM/lmdeploy/pull/4734
The new result adds an end-to-end reproduction on LMDeploy 0.18.0 and demonstrates that accepted media content can be returned through the model response.
Environment
Python: 3.12.3 (main, Jul 15 2026, 23:46:41) [GCC 13.3.0]
CUDA available: True
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 13.0, V13.0.88
CUDA Driver Version: 590.48.01
PyTorch: 2.13.0+cu130
flashinfer_python: 0.6.18
flashinfer_cubin: 0.6.18
flashinfer_jit_cache: 0.6.18+cu130
triton: 3.7.1
transformers: 5.12.1
numpy: 2.3.5
aiohttp: 3.14.3
fastapi: 0.141.1
huggingface_hub: 1.30.0
interegular: 0.3.3
modelscope: 1.39.1
orjson: 3.12.0
outlines: 0.1.11
packaging: 26.3
psutil: 7.2.2
pydantic: 2.13.5
python-multipart: 0.0.32
pyzmq: 27.2.0
uvicorn: 0.52.4
uvloop: 0.22.1
xgrammar: 0.2.1
openai: 2.6.1
tiktoken: 0.14.0
torchcodec: 0.15.0+cu130
ulimit soft: 1024
Error traceback
- Lenguaje dominante
- Python
- Estrellas
- 8.2k
- Forks
- 797
- Merge medio
- 3 d 15 h
- PR fusionados (30 d)
- 52
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de InternLM/lmdeploy
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 2 días
-
[Bug] apply_rotary_pos_emb: leaves output tails unwritten with partial rotationPosiblemente ocupada @shotsan la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
[Bug] PyTorch engine ignores use_rslora, so rsLoRA adapters run sqrt(r) times too weakPosiblemente ocupada @Andreas-Hum la tomó hace 25 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
[Feature] Expose `max_model_len` (session_len) in `/v1/models` model cardPosiblemente ocupada @FOWEPJF255 la tomó hace 37 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 2 días
Todos los issues de InternLM/lmdeploy
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Techiebutler/freeframe#687 ·
Los mantenedores suelen responder en 1 día
-
bug verbose GC
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
IBM/javacore-analyser#677 ·
Los mantenedores suelen responder en 1 día
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NousResearch/hermes-agent#163932 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePosiblemente ocupada @Beehtrix la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
zilliztech/memsearch#907 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[integration]: SynapCoresAbiertoexternal
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
langchain-ai/docs#8386 ·
Los mantenedores suelen responder en 1 día