/

CVE-2026-22807

Severity:

HIGH RISK

(8.8)

Arbitrary Code Execution via Dynamic Code Evaluation

CVE-2026-22807

Modified

Vulnerability type

Category:

Arbitrary Code Execution via Dynamic Code Evaluation

CWE:

CWE-94

Impact:

Remote Code Execution on vLLM Host During Model Load

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

vLLM's model resolution process loads Hugging Face auto_map dynamic modules without properly enforcing the trust_remote_code gate, enabling execution of attacker-controlled Python code bundled with a model repository or local path.

If an attacker can influence which model repo or directory vLLM loads, they can run arbitrary code on the vLLM host during server startup, before any API requests are processed.

Affected context

This vulnerability affects vLLM deployments that automatically resolve and load models from:

  • Remote Hugging Face repositories, or
  • Local directories that may be writable or controlled by less-trusted parties.

The issue appears when auto_map-based dynamic modules in a model's configuration are imported and executed during model resolution without honoring trust_remote_code.

It is most relevant in environments where:

  • Model paths can be influenced by users, CI/CD pipelines, or external configuration, and
  • vLLM runs with meaningful host privileges (e.g., access to secrets, GPUs, internal networks).

Exploit preconditions

  • Attack surface: vLLM model loading pathway (server startup or model hot-load), not the HTTP/GRPC inference API itself.
  • Required access:
  • Ability to control or modify the model repository or local model directory that vLLM is instructed to load, or
  • Ability to point vLLM's configuration/parameters to a malicious or compromised model repo/path.
  • Trigger point: Occurs automatically when vLLM resolves and loads the model, importing auto_map-referenced Python modules.
  • Why exploitation is possible: The model loading logic imports and executes dynamic Python modules associated with the model configuration without gating this behavior behind trust_remote_code, causing untrusted model metadata to be treated as executable code.

Why this happens

This is an example of CWE-94: Improper Control of Generation of Code (Code Injection) in the context of model loading.

Instead of treating model repositories and their configuration as data, the implementation implicitly trusts auto_map entries that reference Python modules and imports them without an explicit trust check.

The insecure pattern is:

  • Coupling configuration-driven module resolution with implicit import/execution
  • Lacking a strong, default-deny mechanism (such as strict trust_remote_code enforcement) for remote or untrusted model sources

Conceptually, executable code is being loaded from a content repository (models) that is often treated as data, enabling an attacker-controlled model repo/path to inject arbitrary behavior at load time.

Potential impact

  • Arbitrary code execution on the vLLM host during model load
  • Theft of environment variables, API keys, and other secrets accessible to the vLLM process
  • Unauthorized access to internal services or lateral movement within the hosting environment
  • Persistence mechanisms deployed on the host via the vLLM process
  • Tampering with model behavior, logging, or response content for downstream users

General mitigation guidance

Effective mitigation focuses on treating model repositories as untrusted content by default and constraining dynamic code loading:

  • Enforce a strict trust boundary around model loading: only allow dynamic module loading from model sources that are explicitly marked as trusted.
  • Prefer configurations and loading paths that do not rely on auto_map-style dynamic modules; favor pure-data model formats and well-defined, vetted architectures.
  • Apply a default-deny policy for remote code execution in model loaders, requiring explicit opt-in and clear operator visibility when enabling any remote code.
  • Run vLLM with least privilege:
  • Minimize file system access where possible (e.g., read-only volumes for models).
  • Limit access to secrets and internal networks from the vLLM process.
  • Isolate vLLM instances that load externally supplied or dynamically selected models using containerization, sandboxes, or separate security domains.
  • Implement strong configuration management so that model paths and repository references cannot be arbitrarily overwritten by less-privileged users or automated processes.

How teams detect issues like this

Organizations can detect and monitor this class of issue using a combination of code-level and operational approaches:

  • Static analysis and code review:
  • Flag patterns where model configuration or metadata drives dynamic imports or auto_map-style resolution.
  • Review model loading code paths for any imports or executions that are not gated by explicit trust flags or allowlists.
  • Policy and configuration checks:
  • Enforce policies that require trust_remote_code-like controls to be honored in all model loading pipelines.
  • Validate deployment manifests and runtime configs to ensure model sources are restricted to vetted repositories.
  • Runtime monitoring:
  • Instrument vLLM containers or hosts to log dynamic imports and unexpected module loads during startup.
  • Monitor for anomalous file system writes, network connections, or process behavior originating from vLLM processes during model initialization.
  • Automated security review tools can be integrated into CI/CD workflows to scan for insecure dynamic code loading patterns before deployment.

Sources

SourceLink
github.comgithub.com/vllm-project/vllm/commit/78d13ea9de4b1ce5e4d8a5af9738fea71fb024e5
github.comgithub.com/vllm-project/vllm/pull/32194
github.comgithub.com/vllm-project/vllm/releases/tag/v0.14.0
github.comgithub.com/vllm-project/vllm/security/advisories/GHSA-2pc9-4j83-qjmr
access.redhat.comaccess.redhat.com/errata/RHSA-2026:10184
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30087
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30088
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30089
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3461
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3462
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3713
access.redhat.comaccess.redhat.com/errata/RHSA-2026:3782
access.redhat.comaccess.redhat.com/errata/RHSA-2026:42644
access.redhat.comaccess.redhat.com/errata/RHSA-2026:5119
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-22807
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2431865
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-22807.json

Frequently asked

questions

Not directly. Exploitation does not require sending crafted inference requests; it occurs when vLLM loads a model whose repository or directory has been compromised or is attacker-controlled. However, if an attacker can influence the model path via a remote configuration or management interface, that remote control can indirectly lead to code execution.

The attacker needs the ability to control the model repo or local directory that vLLM loads, or to influence configuration so that vLLM points to a malicious model source. This could be achieved through compromised CI/CD pipelines, misconfigured write permissions on model directories, or control over a referenced remote model repository.

The safest approach is to enforce a default-deny posture for dynamic code loading: honor trust flags like trust_remote_code, avoid executing code from model metadata by default, and only enable dynamic imports for explicitly trusted and vetted model sources. Additionally, decouple configuration from code execution so that model configs cannot trigger arbitrary imports without explicit operator approval.

Treat model repositories and configs as untrusted input, apply strong trust-gating for any dynamic code paths, and make "no remote code execution" the default for all model loaders. Combine this with least-privilege deployment, strict controls over who can modify model sources or change model paths, and automated checks in CI/CD to detect configuration-driven code execution patterns before they reach production.

Find out what's already
exploitable in your codebase.