Executive brief
LMDeploy is a toolkit used to compress and serve large language models (LLMs). A security flaw allows the software to automatically execute untrusted code embedded within a machine learning model during the loading process. If an attacker can influence which model the system loads, they can gain full control over the server, potentially stealing sensitive data, API keys, or interfering with AI operations.
Technical details
LMDeploy (versions <= 0.12.3) hardcodes the 'trust_remote_code=True' parameter in multiple HuggingFace Transformers API call sites, specifically within 'lmdeploy/archs.py' and 'lmdeploy/utils.py'. This parameter allows HuggingFace models to execute arbitrary Python code defined in the model repository during initialization. An attacker who can influence the 'model_path'—via deployment configurations, CI/CD pipelines, or container settings—can point the service to a malicious repository. Upon loading, the malicious code executes with the privileges of the LMDeploy process, leading to full system compromise. As of publication, no patches are available.
Affected products
- InternLM LMDeploy <= 0.12.3
Timeline
- 2026-05-15: advisory: GitHub Security Advisory published by researcher
- 2026-06-10: disclosed: CVE published to NVD