[Bug] Request-controlled processor pixel override removes image size limits, causing resource amplification
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start with lmdeploy/vl/model/preprocess_utils.py:32-55 to trace how min_pixels and max_pixels are accepted, then follow the override path through lmdeploy/vl/model/base.py:123-175 and the OpenAI protocol fields. Check existing tests for processor overrides and add coverage for an excessively large max_pixels value. Done means request supplied pixel limits cannot exceed a safe absolute bound and the behavior is covered by tests.
索引モデルが issue の本文から書いたものです。
説明
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
The OpenAI API forwards mm_processor_kwargs.image into a Hugging Face image processor. LMDeploy maps caller-supplied min_pixels and max_pixels to shortest_edge and longest_edge, but enforces no absolute upper bound. On Qwen3.5-0.8B, an override with max_pixels=1e15 caused a 62518-token image prompt from an HTTP request, versus 16402 tokens by default, and increased wall time from 7.07 to 27.41 seconds. A direct processor test also attempted a 3 TB tensor allocation and failed only at the allocator level.
Affected component
LMDeploy multimodal processor override path:
lmdeploy/serve/openai/protocol.py:234andlmdeploy/serve/openai/protocol.py:621exposemm_processor_kwargs.lmdeploy/vl/model/base.py:123-175passesmm_processor_kwargs.imageinto the override helper.lmdeploy/vl/model/preprocess_utils.py:32-55acceptsmin_pixelsandmax_pixels; the only observed fallback ismin_pixels > max_pixels, not an absolute maximum.
Impact
A caller can override a model's configured image pixel budget upward. Depending on the model processor, image dimensions, session limit, batch size, and available CPU/accelerator memory, this can cause large CPU tensor allocations, severe prefill latency, request rejection, GPU OOM, or host memory pressure. The demonstrated Qwen3.5 case is model/processor-specific and should not be generalized to every multimodal model.
Reproduction
Preconditions
The attacker can submit a chat completion request containing an image.
The target model uses LMDeploy's generic vision path and a processor that consumes
shortest_edge/longest_edge. Qwen3.5-0.8B does.The request reaches the multimodal processor; API authentication, if enabled, must be satisfied.
Tested environment
Target: LMDeploy 0.18.0 Linux cp312 wheel.
Wheel SHA-256:
fcef7cf0d210d766e02e2e6df025378d2f8ae36080400b2818eb9a34ef3392dc.Model:
/mnt/sdb18t/ljp/models/Qwen3.5-0.8B.Service: real LMDeploy OpenAI server, PyTorch backend, GPU0 only.
GPU: one NVIDIA PCIe only.
HTTP session limit: 65536 tokens.
Host: Ubuntu 22.04, Linux 6.8.0-149-generic, x86_64.
Test date: 2026-12-04 (Asia/Shanghai).
Proof of concept
An 8000x8000 PNG was sent as a base64 image URL with:
{
"mm_processor_kwargs": {
"image": {
"min_pixels": 4096,
"max_pixels": 1000000000000000
}
}
}A second processor-only test used a 6144x6144 image with the real Qwen3.5 image processor and requested:
{
"min_pixels": 1000000000000,
"max_pixels": 1000000000000000
}Results
Real HTTP result:
Case | HTTP | Prompt tokens | Wall time -- | -- | -- | -- Default | 200 | 16402 | 7.07 s max_pixels=1e15 override | 200 | 62518 | 27.41 sThe huge override raised:
RuntimeError: DefaultCPUAllocator: can't allocate memory: you tried to allocate
3000000000000 bytes. Error code 12 (Cannot allocate memory)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
- 主要言語
- Python
- スター
- 8.2k
- フォーク
- 797
- 平均マージ
- 3日 15時間
- マージ済み PR(30日)
- 52
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
InternLM/lmdeploy のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 2 日以内に返信
-
[Bug] apply_rotary_pos_emb: leaves output tails unwritten with partial rotation対応中かも @shotsan が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
[Bug] PyTorch engine ignores use_rslora, so rsLoRA adapters run sqrt(r) times too weak対応中かも @Andreas-Hum が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
[Feature] Expose `max_model_len` (session_len) in `/v1/models` model card対応中かも @FOWEPJF255 が 37 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 2 日以内に返信
InternLM/lmdeploy の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Techiebutler/freeframe#687 ·
メンテナーはふだん 1 日以内に返信
-
bug verbose GC
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
IBM/javacore-analyser#677 ·
メンテナーはふだん 1 日以内に返信
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#163932 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's file対応中かも @Beehtrix が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
zilliztech/memsearch#907 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
external
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
langchain-ai/docs#8386 ·
メンテナーはふだん 1 日以内に返信