CVE-2026-46517
LMDeploy: Hardcoded trust_remote_code=True is an implicit unsafe remote-code load path with no user opt-out
LMDeploy is a toolkit for compressing, deploying, and serving large language models. In versions 0.12.3 and prior, hardcoded "trust_remote_code=True" enables HF supply-chain RCE without user opt-in. Version 0.13.0 patches the issue.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
7.8
LMDeploy: Hardcoded trust_remote_code=True is an implicit unsafe remote-code load path with no user opt-out
LMDeploy is a toolkit for compressing, deploying, and serving large language models. In versions 0.12.3 and prior, hardcoded "trust_remote_code=True" enables HF supply-chain RCE without user opt-in. Version 0.13.0 patches the issue.
- Record
CVE-2026-46517- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-94, CWE-915, CWE-1188
- Updated
- 2026-11-02
EUVDEUVD-2026-35874
7.8
LMDeploy is a toolkit for compressing, deploying, and serving large language models. In versions 0.12.3 and prior, hardcoded "trust_remote_code=True" enables HF supply-chain RCE without user opt-in. Version 0.13.0 patches the issue.
- Record
EUVD-2026-35874- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-9xq9-36w5-q796
7.8
lmdeploy: Hardcoded trust_remote_code=True is an implicit unsafe remote-code load path with no user opt-out
📋 Reframing (2026-05-02): implicit unsafe remote-code path, not "supply-chain"
The accurate description of this vulnerability is: "
get_model_archand related helpers hardcodetrust_remote_code=Truewith no opt-out, creating an implicit unsafe remote-code load path on every model fetch."What this report does NOT claim:
- It is NOT a network-attack RCE — the user supplies the model reference; LMDeploy honors it.
- It is NOT a "supply chain" CVE in the classical sense (where a benign upstream is compromised) — the user explicitly types the repo name.
What this report DOES claim:
- Other inference frameworks (vLLM, TGI, Hugging Face transformers itself) all expose
--trust-remote-codeas opt-in so that users who consciously load known-safe repos can opt in, while users following a tutorial cannot accidentally execute attacker Python by typing a wrong repo name.- LMDeploy's hardcoded True is an implicit trust-boundary override that violates HF Transformers' default-secure stance (
trust_remote_code=Falsesince transformers ≥ 4.30).- The fix is a one-line CLI flag (
--trust-remote-code) defaulting False, threaded through the three sites, matching the rest of the ecosystem.Severity should be assessed as hardening / safe-by-default, not as full unauthenticated RCE. CVSS revised to 5.5 Medium (
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H× user-must-load qualifier).Runtime evidence: see
12_lmdeploy_trust_remote_code_F13/runtime_evidence/cloudrun_cpu_verdict.txt.
F13 — LMDeploy: hardcoded trust_remote_code=True enables HF supply-chain RCE without user opt-in
Reporter: ibondarenko1 / [email protected] Coordinated-disclosure window: 90 days from initial vendor email.
TL;DR
LMDeploy unilaterally passes trust_remote_code=True to
transformers.AutoConfig.from_pretrained() (and several other
from_pretrained callers) regardless of any user opt-in. The
flag is hardcoded True in source — there is no CLI flag, no
environment variable, no parameter, and no warning that lets a
user refuse remote code execution from the model repository.
This is a silent override of HuggingFace Transformers' own
default-secure stance (trust_remote_code=False) introduced
in HF Transformers ≥ 4.30 specifically to prevent this class of
supply-chain RCE.
The user running lmdeploy serve api_server <attacker_repo>,
lmdeploy lite calibrate <attacker_repo>, etc. has no way to
opt out. The only escape hatch is for the user to never load
any third-party HF repo with LMDeploy — which is incompatible
with LMDeploy's documented use case.
HuggingFace's trust_remote_code=False default exists exactly to
prevent silent RCE when loading a third-party repo. LMDeploy overrides
this default, restoring the unsafe behaviour transparently. A malicious
HF repo with a configuration_*.py shim runs Python code as the
LMDeploy user at the very first call to get_model_arch(...).
This is a documented anti-pattern (see HF Hub docs:
"Trusting custom code is therefore tricky..."). Multiple peer
projects fixed similar issues — e.g. Hugging Face Transformers
itself made this opt-in by default, and vllm exposes the flag
through --trust-remote-code rather than hardcoding it.
Affected version
- Repository:
github.com/InternLM/lmdeploy, branchmain. - Branch SHA at audit time:
9df0eff7c38ae69b9d4b9f7ad1441e484d439f92(2026-05-02). - Pinned blob SHAs:
lmdeploy/archs.py→68fa03a407734be1e2ae04098d34e9acdbe98262lmdeploy/lite/apis/calibrate.py→0728304bdc3c03eee1d790bfbd5496df080a0ecdlmdeploy/lite/utils/load.py→7c61677aa01e2d9881e32f8ca8ef6ad0f1d8b120lmdeploy/pytorch/check_env/model.py→b1a2daaa426bf5fe25030f7913c703eed9f5b261
Snapshots of all four files are in source_pinned/.
Source-level evidence
Site 1 — architecture…
- Record
GHSA-9xq9-36w5-q796- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-94, CWE-915, CWE-1188
- Updated
- 2026-11-02
NVD
7.8
LMDeploy is a toolkit for compressing, deploying, and serving large language models. In versions 0.12.3 and prior, hardcoded "trust_remote_code=True" enables HF supply-chain RCE without user opt-in. Version 0.13.0 patches the issue.
- Record
CVE-2026-46517- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-94, CWE-915, CWE-1188
- Updated
- 2026-11-02
OSV
7.8
LMDeploy: Hardcoded trust_remote_code=True is an implicit unsafe remote-code load path with no user opt-out
LMDeploy is a toolkit for compressing, deploying, and serving large language models. In versions 0.12.3 and prior, hardcoded "trust_remote_code=True" enables HF supply-chain RCE without user opt-in. Version 0.13.0 patches the issue.
- Record
CVE-2026-46517- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-1188, CWE-915, CWE-94
- Updated
- 2026-11-02
OSVGHSA-9xq9-36w5-q796
7.8
lmdeploy: Hardcoded trust_remote_code=True is an implicit unsafe remote-code load path with no user opt-out
📋 Reframing (2026-05-02): implicit unsafe remote-code path, not "supply-chain"
The accurate description of this vulnerability is: "
get_model_archand related helpers hardcodetrust_remote_code=Truewith no opt-out, creating an implicit unsafe remote-code load path on every model fetch."What this report does NOT claim:
- It is NOT a network-attack RCE — the user supplies the model reference; LMDeploy honors it.
- It is NOT a "supply chain" CVE in the classical sense (where a benign upstream is compromised) — the user explicitly types the repo name.
What this report DOES claim:
- Other inference frameworks (vLLM, TGI, Hugging Face transformers itself) all expose
--trust-remote-codeas opt-in so that users who consciously load known-safe repos can opt in, while users following a tutorial cannot accidentally execute attacker Python by typing a wrong repo name.- LMDeploy's hardcoded True is an implicit trust-boundary override that violates HF Transformers' default-secure stance (
trust_remote_code=Falsesince transformers ≥ 4.30).- The fix is a one-line CLI flag (
--trust-remote-code) defaulting False, threaded through the three sites, matching the rest of the ecosystem.Severity should be assessed as hardening / safe-by-default, not as full unauthenticated RCE. CVSS revised to 5.5 Medium (
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H× user-must-load qualifier).Runtime evidence: see
12_lmdeploy_trust_remote_code_F13/runtime_evidence/cloudrun_cpu_verdict.txt.
F13 — LMDeploy: hardcoded trust_remote_code=True enables HF supply-chain RCE without user opt-in
Reporter: ibondarenko1 / [email protected] Coordinated-disclosure window: 90 days from initial vendor email.
TL;DR
LMDeploy unilaterally passes trust_remote_code=True to
transformers.AutoConfig.from_pretrained() (and several other
from_pretrained callers) regardless of any user opt-in. The
flag is hardcoded True in source — there is no CLI flag, no
environment variable, no parameter, and no warning that lets a
user refuse remote code execution from the model repository.
This is a silent override of HuggingFace Transformers' own
default-secure stance (trust_remote_code=False) introduced
in HF Transformers ≥ 4.30 specifically to prevent this class of
supply-chain RCE.
The user running lmdeploy serve api_server <attacker_repo>,
lmdeploy lite calibrate <attacker_repo>, etc. has no way to
opt out. The only escape hatch is for the user to never load
any third-party HF repo with LMDeploy — which is incompatible
with LMDeploy's documented use case.
HuggingFace's trust_remote_code=False default exists exactly to
prevent silent RCE when loading a third-party repo. LMDeploy overrides
this default, restoring the unsafe behaviour transparently. A malicious
HF repo with a configuration_*.py shim runs Python code as the
LMDeploy user at the very first call to get_model_arch(...).
This is a documented anti-pattern (see HF Hub docs:
"Trusting custom code is therefore tricky..."). Multiple peer
projects fixed similar issues — e.g. Hugging Face Transformers
itself made this opt-in by default, and vllm exposes the flag
through --trust-remote-code rather than hardcoding it.
Affected version
- Repository:
github.com/InternLM/lmdeploy, branchmain. - Branch SHA at audit time:
9df0eff7c38ae69b9d4b9f7ad1441e484d439f92(2026-05-02). - Pinned blob SHAs:
lmdeploy/archs.py→68fa03a407734be1e2ae04098d34e9acdbe98262lmdeploy/lite/apis/calibrate.py→0728304bdc3c03eee1d790bfbd5496df080a0ecdlmdeploy/lite/utils/load.py→7c61677aa01e2d9881e32f8ca8ef6ad0f1d8b120lmdeploy/pytorch/check_env/model.py→b1a2daaa426bf5fe25030f7913c703eed9f5b261
Snapshots of all four files are in source_pinned/.
Source-level evidence
Site 1 — architecture…
- Record
GHSA-9xq9-36w5-q796- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-1188, CWE-915, CWE-94
- Updated
- 2026-11-02
OSVPYSEC-2026-2608
7.8
lmdeploy: Hardcoded trust_remote_code=True is an implicit unsafe remote-code load path with no user opt-out
📋 Reframing (2026-05-02): implicit unsafe remote-code path, not "supply-chain"
The accurate description of this vulnerability is: "
get_model_archand related helpers hardcodetrust_remote_code=Truewith no opt-out, creating an implicit unsafe remote-code load path on every model fetch."What this report does NOT claim:
- It is NOT a network-attack RCE — the user supplies the model reference; LMDeploy honors it.
- It is NOT a "supply chain" CVE in the classical sense (where a benign upstream is compromised) — the user explicitly types the repo name.
What this report DOES claim:
- Other inference frameworks (vLLM, TGI, Hugging Face transformers itself) all expose
--trust-remote-codeas opt-in so that users who consciously load known-safe repos can opt in, while users following a tutorial cannot accidentally execute attacker Python by typing a wrong repo name.- LMDeploy's hardcoded True is an implicit trust-boundary override that violates HF Transformers' default-secure stance (
trust_remote_code=Falsesince transformers ≥ 4.30).- The fix is a one-line CLI flag (
--trust-remote-code) defaulting False, threaded through the three sites, matching the rest of the ecosystem.Severity should be assessed as hardening / safe-by-default, not as full unauthenticated RCE. CVSS revised to 5.5 Medium (
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H× user-must-load qualifier).Runtime evidence: see
12_lmdeploy_trust_remote_code_F13/runtime_evidence/cloudrun_cpu_verdict.txt.
F13 — LMDeploy: hardcoded trust_remote_code=True enables HF supply-chain RCE without user opt-in
Reporter: ibondarenko1 / [email protected] Coordinated-disclosure window: 90 days from initial vendor email.
TL;DR
LMDeploy unilaterally passes trust_remote_code=True to
transformers.AutoConfig.from_pretrained() (and several other
from_pretrained callers) regardless of any user opt-in. The
flag is hardcoded True in source — there is no CLI flag, no
environment variable, no parameter, and no warning that lets a
user refuse remote code execution from the model repository.
This is a silent override of HuggingFace Transformers' own
default-secure stance (trust_remote_code=False) introduced
in HF Transformers ≥ 4.30 specifically to prevent this class of
supply-chain RCE.
The user running lmdeploy serve api_server <attacker_repo>,
lmdeploy lite calibrate <attacker_repo>, etc. has no way to
opt out. The only escape hatch is for the user to never load
any third-party HF repo with LMDeploy — which is incompatible
with LMDeploy's documented use case.
HuggingFace's trust_remote_code=False default exists exactly to
prevent silent RCE when loading a third-party repo. LMDeploy overrides
this default, restoring the unsafe behaviour transparently. A malicious
HF repo with a configuration_*.py shim runs Python code as the
LMDeploy user at the very first call to get_model_arch(...).
This is a documented anti-pattern (see HF Hub docs:
"Trusting custom code is therefore tricky..."). Multiple peer
projects fixed similar issues — e.g. Hugging Face Transformers
itself made this opt-in by default, and vllm exposes the flag
through --trust-remote-code rather than hardcoding it.
Affected version
- Repository:
github.com/InternLM/lmdeploy, branchmain. - Branch SHA at audit time:
9df0eff7c38ae69b9d4b9f7ad1441e484d439f92(2026-05-02). - Pinned blob SHAs:
lmdeploy/archs.py→68fa03a407734be1e2ae04098d34e9acdbe98262lmdeploy/lite/apis/calibrate.py→0728304bdc3c03eee1d790bfbd5496df080a0ecdlmdeploy/lite/utils/load.py→7c61677aa01e2d9881e32f8ca8ef6ad0f1d8b120lmdeploy/pytorch/check_env/model.py→b1a2daaa426bf5fe25030f7913c703eed9f5b261
Snapshots of all four files are in source_pinned/.
Source-level evidence
Site 1 — architecture…
- Record
PYSEC-2026-2608- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
lmdeployPyPI |
through 0.12.3 | 0.13.0 |
lmdeployPyPI |
before 0.13.0, plus listed versions 0.0.100.0.110.0.120.0.130.0.14 Show 45 moreShow less0.1.00.10.00.10.10.10.20.11.00.11.10.12.00.12.10.12.20.12.30.2.00.2.10.2.20.2.30.2.40.2.50.2.60.3.00.4.00.4.10.4.20.5.00.5.10.5.20.5.2.post10.5.30.6.00.6.0a00.6.10.6.20.6.2.post10.6.30.6.40.6.50.7.00.7.0.post10.7.0.post20.7.0.post30.7.10.7.20.7.2.post10.7.30.8.00.9.00.9.1 |
0.13.0 |
lmdeployPyPI |
through 0.12.3, plus listed versions 0.0.100.0.110.0.120.0.130.0.14 Show 45 moreShow less0.1.00.10.00.10.10.10.20.11.00.11.10.12.00.12.10.12.20.2.00.2.10.2.20.2.30.2.40.2.50.2.60.3.00.4.00.4.10.4.20.5.00.5.10.5.20.5.2.post10.5.30.6.00.6.0a00.6.10.6.20.6.2.post10.6.30.6.40.6.50.7.00.7.0.post10.7.0.post20.7.0.post30.7.10.7.20.7.2.post10.7.30.8.00.9.00.9.10.9.2 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-46517 is a high vulnerability (CVSS 7.8) in Internlm Lmdeploy, published May 21, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.16%, the 5th percentile. Fixed in lmdeploy 0.13.0.
References
github.com/InternLM/lmdeploy/security/advisories/GHSA-9xq9-36w5-q796
github.com/github/advisory-database/pull/4511
github.com/InternLM/lmdeploy/commit/81be52961aa324fd5cd3cacebffba1ba051bc107
github.com/InternLM/lmdeploy/blob/v0.13.0/lmdeploy/version.py
github.com/InternLM/lmdeploy/releases/tag/v0.13.0
github.com/pypa/advisory-database/tree/main/vulns/lmdeploy/PYSEC-2026-2608.yaml
Left out here: 3 versions and the rest of 3 source descriptions. The JSON record has them.