T03 · Remote Payload Retrieval and Execution
Error
- Location
- SKILL.md:47
- Finding
- Unconditional Execution of Model-Supplied Remote Code<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:47-56`; additional occurrences at `scripts/run_benchmark.py:71-85` and `references/benchmark-profiles.md:30-45` **Vulnerability Type**: Untrusted model code execution **Risk Level**: High ### Vulnerable Code ```bash vllm serve <MODEL_PATH> \ --tensor-parallel-size <TP_SIZE> \ --max-num-batched-tokens 4096 \ --max-num-seqs 256 \ --trust-remote-code \ --port 8000 \ <EXTRA_ARGS> ``` The benchmark client also enables the same behavior: ```python cmd = [ "vllm", "bench", "serve", "--host", "127.0.0.1", "--port", str(args.port), "--backend", "openai-chat", "--model", args.model, "--tokenizer", args.tokenizer, "--dataset-name", "random", "--endpoint", "/v1/chat/completions", "--ignore-eos", "--trust-remote-code", "--random-input-len", str(args.input_len), "--random-output-len", str(args.output_len), "--num-prompts", str(args.num_prompts), ] ``` ### Technical Analysis The Skill unconditionally supplies `--trust-remote-code` when starting vLLM and when loading the tokenizer through the benchmark client. This option permits model repositories to provide and execute custom Python implementations during model or tokenizer initialization. The model path or identifier originates from the user or preceding workflow context. If it refers to a malicious or compromised remote repository, repository-controlled Python can execute inside the container. The executable content may also change after the Skill itself has been reviewed unless the model repository and revision are pinned. This capability is unnecessary for models natively supported by vLLM and therefore exceeds the minimum privileges required for general performance benchmarking. ### Attack Path 1. An attacker supplies a malicious model repository identifier, or compromises a repository expected by the operator. 2. The operator or Agent passes that identifier as `MODEL_PATH` ...[truncated 1230 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--trust-remote-code` from both server and benchmark commands by default. 2. Require explicit, informed user approval before enabling it for a model that cannot run without custom code. 3. Allow only reviewed model repositories and pin each model to an immutable commit or revision. 4. Download and inspect required custom model code before execution rather than trusting mutable repository content at runtime. 5. Run custom model code in a dedicated, unprivileged container with: - No Docker socket. - No privileged mode. - No host-sensitive mounts. - No credentials or unrelated secrets. - A read-only root filesystem where practical. - Dropped Linux capabilities and a non-root user. - Restricted outbound network access. 6. Separate the model-serving environment from containers containing sensitive benchmark data. 7. Record the repository, immutable revision, and whether remote code was authorized in the generated report. ]]>
