﻿# LMDeploy remote-code advisory: inspect the effective permission

LMDeploy hardcoded remote-code trust during initialization. Compare conflicting advisory fields with tagged source and trace the permission your service actually uses.

Author: Retrivium editorial team
Updated: 2026-11-05
Canonical URL: https://retrivium.ai/journal/lmdeploy-forced-remote-code-trust-advisory-tagged-fix/
Language: en

LMDeploy's GHSA-m549-qq94-fvhg concerns an implicit permission decision during model initialization. Certain loading paths hardcoded `trust_remote_code=True`, allowing repository Python code to run without a separate operator opt-in. A model selection interface can consequently become a code-selection interface when an attacker controls the selected repository or path.

## Configuration loading can cross the execution boundary

The [project advisory](https://github.com/InternLM/lmdeploy/security/advisories/GHSA-m549-qq94-fvhg) identifies configuration-related calls in `archs.py` and `utils.py`, including architecture and generation-configuration loading. It confirms affected versions through 0.12.3 and describes code executing with the serving process's privileges when an attacker controls the model path.

This prerequisite matters. The report does not establish that an arbitrary chat prompt controls the model repository in every deployment. Trace the actual source of model selection: a deployment manifest, administration interface, automated catalog or user-submitted identifier. The privilege boundary depends on who can influence that source and what the initializing process can access. Initialization occurs before ordinary inference, so filtering generated answers cannot repair the loader's trust decision.

## Reconcile the advisory with the tagged implementation

The project's patched-version field says None, whereas the [GitHub database record](https://github.com/advisories/GHSA-m549-qq94-fvhg) identifies 0.13.0 as patched and assigns CVE-2026-46432. These fields should not be silently presented as agreeing.

There is additional implementation evidence: the [v0.13.0 architecture loader](https://raw.githubusercontent.com/InternLM/lmdeploy/v0.13.0/lmdeploy/archs.py) gives its trust parameter a false default and propagates the chosen value into configuration loading. The [tagged generation-configuration helper](https://raw.githubusercontent.com/InternLM/lmdeploy/v0.13.0/lmdeploy/utils.py) does likewise. This supports the change in those inspected paths; it is not an exhaustive certification of every model integration or future release.

For an installed service, preserve the exact application version and inspect the entry point and effective option it actually uses. A fixed default offers little protection if an old deployment template explicitly reenables remote-code trust for every model.

## Tensor serialization and repository code are separate

The [Transformers custom-model documentation](https://huggingface.co/docs/transformers/en/custom_models) explains how configuration and model implementation code can accompany weights and how custom loading uses the trust option. Selecting safetensors for tensor storage does not remove a separately authorized Python import.

The existing [custom-code review guide](/journal/huggingface-remote-code-review/) describes a deliberate review and revision-pinning process. Apply that decision to the repository code actually selected, including configuration implementations and dependencies. A familiar model family name does not establish that a particular repository revision uses a built-in implementation. Likewise, pinning a revision fixes identity for review; it does not turn unreviewed code into trusted code.

## Validate the deployment's permission flow

A proposed review should follow the setting from the public launch interface through architecture detection, tokenizer or processor initialization and engine construction. Record any wrapper that overwrites the value or chooses another model during fallback. Check compatibility using accepted models under the intended policy rather than enabling the flag as a generic response to startup errors.

Keep artifact identity, code permission and process privileges in the same deployment record while retaining them as separate decisions. The [artifact-validation guide](/journal/safetensors-artifact-validation/) explains the complementary integrity checks. No model repository or advisory demonstration was executed for this article. The defensible conclusion is a scoped account of the historical forced-trust behavior, the observed corrective code and the operator's effective permission path.
