Back to skill

Security audit

ROCm vLLM Deployment

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its vLLM deployment purpose, but its helper scripts and guidance create review-worthy risks around token exposure, shell startup execution, persistent credentials, and unpinned runtime components.

Review before installing or running in production. Prefer passing HF_TOKEN only for the specific command, do not store it in shell startup files or deployment reports, avoid running check-env.sh until its ~/.bashrc sourcing behavior is removed, use a pinned and reviewed container image, and restrict model IDs to safe directory names.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate-report.sh:24
Finding

Unvalidated Model ID Allows Path Traversal and File Overwrite

Content
View full analysis
"$REPORT_FILE" << EOF ``` ### Technical Analysis The script uses the attacker-controlled `MODEL_ID` argument directly as a path component. It does not reject absolute paths, `..` traversal components, directory separators, symbolic links, or unexpected characters. Although the script verifies that `OUTPUT_DIR` exists, it does not establish that the canonical directory remains inside `$HOME/vllm-compose`. The subsequent redirection truncates or creates `DEPLOYMENT_REPORT.md` in the resolved directory. Shell quoting prevents word splitting and command substitution at this location, but it does not prevent filesystem path traversal. The fixed output filename limits the overwrite target to a file named `DEPLOYMENT_REPORT.md`; however, an attacker can target any existing writable directory reachable from the invoking account. ### Attack Path 1. The attacker identifies or creates a writable target directory, such as `$HOME/target`. 2. The attacker invokes the script with a traversing model ID: ```bash ./scripts/generate-report.sh \ "../../target" \ "container" \ "8000" \ "Success" ``` 3. `OUTPUT_DIR` resolves lexically to: ```text $HOME/vllm-compose/../../target ``` 4. If the resolved directory exists, the directory check succeeds. 5. The script opens `DEPLOYMENT_REPORT.md` with shell redirection and truncates any existing file at that location. 6. Report content containing attacker-suppli ...[truncated 659 chars]
Remediation
View remediation
&2 exit 1 fi ``` 3. Explicitly reject absolute paths, `/`, backslashes, empty components, `.` components, and `..` components. 4. Resolve both the base directory and destination with `realpath`, then enforce containment: ```bash BASE_DIR="$(realpath -m "$HOME/vllm-compose")" OUTPUT_DIR="$(realpath -m "$BASE_DIR/$MODEL_ID")" case "$OUTPUT_DIR/" in "$BASE_DIR"/*) ;; *) echo "ERROR: Output path escapes deployment root" >&2 exit 1 ;; esac ``` 5. Reject symbolic-link output directories or verify the canonical path after resolving links. 6. Create reports atomically using a securely created temporary file inside the validated output directory, then rename it into place. 7. Avoid overwriting an existing report unless replacement was explicitly requested. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/check-env.sh:58
Finding

Hugging Face Token Prefix Is Exposed in Output and Persistent Reports

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/check-env.sh:68
Finding

Environment Check Executes the Entire User Shell Initialization File

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
SKILL.md:121
Finding

Deployment Workflow Uses Mutable Nightly Image and Unpinned Python Dependency

Content
View full analysis
Remediation
View remediation
``` 2. Record the expected image digest in version-controlled configuration and verify it before launch. 3. Prefer a stable release over a nightly development image for production. 4. Verify container signatures or provenance attestations where supported. 5. Pin `huggingface_hub` and all relevant transitive dependencies to reviewed versions. 6. Use a lock file and require hashes, for example: ```bash pip install --require-hashes -r requirements.txt ``` 7. Restrict package installation to an explicitly trusted index. 8. Run the container as a non-root user where compatible and grant only required devices, mounts, environment variables, and network access. 9. Avoid passing `HF_TOKEN` into the serving container unless runtime access is strictly required. Prefer completing authenticated downloads before launch. 10. Add a controlled update procedure that reviews, tests, and records dependency and image changes before production deployment. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (19)

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The skill explicitly supports storing HF_TOKEN in a per-model .env file under the user's home directory. Even with chmod 600, persisting credentials on disk increases exposure through backups, accidental inclusion in archives, later permission drift, or other local compromise; the danger is heightened because deployment logs and artifacts are centralized in one predictable directory.

Content

Scanner excerpt · SKILL.md (reported line 177)May include surrounding context.

├── deployment.log # Full deployment logs (stdout + stderr) ├── test-results.json # Functional test results (JSON format) ├── docker-compose.yml # Generated Docker Compose file ├── .env # HF_TOKEN environment (chmod 600, optional) └── DEPLOYMENT_REPORT.md # Human-readable deployment summary

text

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The best-practices section normalizes both .env storage and shell-profile storage for HF_TOKEN, which encourages long-lived local credential persistence. This is risky because it broadens the credential exposure surface and may lead users or agents to place secrets in files that are later read, sourced, copied, or mishandled.

Content

Scanner excerpt · SKILL.md (reported line 359)May include surrounding context.

md
## Security Best Practices

1. **Never commit tokens to version control** — Add `.env` to `.gitignore`
2. **Use .env files with chmod 600** — Restrict access to owner only
3. **Mask tokens in logs** — Show only first 10 chars: `${TOKEN:0:10}...`
4. **Pass tokens at runtime** — `HF_TOKEN=$HF_TOKEN docker compose up -d`
5. **Store tokens in ~/.bash_profile** — For production environments, set `HF_TOKEN` in user's shell config

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Accessing HF_TOKEN and disclosing a visible prefix in the report unnecessarily exposes credential material. Credential fragments are still sensitive because they confirm token presence and can help an attacker distinguish, match, or validate stolen secrets from other sources.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill clearly instructs shell execution, Docker operations, environment sourcing, and file writes, but it declares no explicit tool scope or permissions boundary. That mismatch is dangerous because an agent may execute powerful host-level actions without an auditable least-privilege contract, increasing the chance of unintended command execution or unsafe automation.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 177)May include surrounding context.

├── deployment.log # Full deployment logs (stdout + stderr) ├── test-results.json # Functional test results (JSON format) ├── docker-compose.yml # Generated Docker Compose file ├── .env # HF_TOKEN environment (chmod 600, optional) └── DEPLOYMENT_REPORT.md # Human-readable deployment summary

text

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 268)May include surrounding context.

├── deployment.log # Full deployment logs (stdout + stderr) ├── test-results.json # Functional test results (JSON format) ├── docker-compose.yml # Generated Docker Compose file ├── .env # HF_TOKEN environment (chmod 600, optional) └── DEPLOYMENT_REPORT.md # Human-readable deployment summary

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The skill instructs users to add HF_TOKEN to ~/.bash_profile and source it, creating persistent credential presence across future sessions. Session persistence is dangerous here because the file may later be read by tools, copied during migrations, included in backups, or unintentionally exposed through debugging and support workflows.

Content

Scanner excerpt · SKILL.md (reported line 243)May include surrounding context.

md
echo "ERROR: Model download failed - authentication required"
echo "This model requires a valid HF_TOKEN."
echo ""
echo "Please add to ~/.bash_profile:"
echo "  export HF_TOKEN=\"hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\""
echo "Then run: source ~/.bash_profile"
exit 1

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

The skill pulls rocm/vllm-dev:nightly, which is a moving tag rather than a pinned immutable digest. This creates supply-chain risk: future executions may fetch different, unreviewed container contents, including compromised or breaking images, with direct access to GPU devices and mounted host paths.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 359)May include surrounding context.

md
## Security Best Practices

1. **Never commit tokens to version control** — Add `.env` to `.gitignore`
2. **Use .env files with chmod 600** — Restrict access to owner only
3. **Mask tokens in logs** — Show only first 10 chars: `${TOKEN:0:10}...`
4. **Pass tokens at runtime** — `HF_TOKEN=$HF_TOKEN docker compose up -d`
5. **Store tokens in ~/.bash_profile** — For production environments, set `HF_TOKEN` in user's shell config

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The troubleshooting section reinforces creation and use of ~/.bash_profile for storing authentication and cache configuration, again promoting long-lived environment persistence. In this deployment context, that makes the skill more dangerous because it combines persistent secrets with shell execution, Docker launch, and centralized artifact generation, increasing the odds of secondary disclosure.

Content

Scanner excerpt · SKILL.md (reported line 373)May include surrounding context.

md
|-------|----------|
| `HF_TOKEN not set` | Add `export HF_TOKEN="hf_xxx"` to `~/.bash_profile`, then `source ~/.bash_profile`. Or provide via parameter. |
| `HF_HOME not set` | defaults to `/root/.cache/huggingface/hub`. For production, add `export HF_HOME="/path"` to `~/.bash_profile`. |
| `~/.bash_profile not found` | Create `~/.bash_profile` and add environment variables. |
| `Changes not taking effect` | Run `source ~/.bash_profile` or restart terminal. |
| `HF_TOKEN provided but download still fails` | Token may be invalid or lack access to the model. Verify token at https://huggingface.co/settings/tokens |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 391)May include surrounding context.

md
|-------|----------|
| hf CLI not found | `pip install huggingface_hub` |
| Docker Compose fails | Use `docker compose` (no hyphen) |
| GPU access fails | Add user to `render` group: `sudo usermod -aG render $USER` |
| Port in use | Change `port` parameter |
| OOM | Reduce `gpu_memory_utilization` |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script prints the first part of HF_TOKEN to stdout, exposing sensitive credential material in terminals, logs, CI output, or orchestration telemetry. Even partial token disclosure can aid token identification, correlation, or accidental leakage in shared operational environments.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script sources ~/.bashrc, which executes arbitrary shell commands from a user-controlled file rather than safely reading only the needed variables. In an automation or elevated execution context, this can trigger unintended command execution, side effects, or privilege misuse simply by running an environment check.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script executes ~/.bashrc without a strong warning or explicit consent, introducing hidden side effects in a tool described as an environment checker. Users may reasonably expect validation only, but this behavior can run aliases, shell hooks, network calls, or arbitrary commands embedded in shell startup files.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/check-env.sh (reported line 112)May include surrounding context.

sh
log "  - Public models: Will proceed without authentication"
    log "  - Gated models: Will fail at download time with clear error"
    log ""
    log "To avoid authentication errors, add to ~/.bashrc:"
    log "  export HF_TOKEN=\"hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\""
else
    log "✓ HF_TOKEN: ${HF_TOKEN:0:10}... (source: $HF_TOKEN_SOURCE)"

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script intentionally includes Hugging Face token status in the generated markdown report and exposes the first 10 characters of HF_TOKEN. Even partial credential disclosure can aid token identification, correlation across systems, or accidental leakage if the report is shared, committed, or copied into tickets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The report persists raw test response content from test-results.json into a markdown file without sanitization or warning. Model responses, prompts, or logs may contain sensitive data, and writing them into a human-readable report increases the chance of unintended disclosure through sharing, backups, or source control.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate-report.sh (reported line 226)May include surrounding context.

sh
tail -f $OUTPUT_DIR/deployment.log

# Test endpoint
curl http://localhost:$PORT/v1/chat/completions \\
  -H "Content-Type: application/json" \\
  -d '{"model":"$MODEL_ID","messages":[{"role":"user","content":"Hello"}],"max_tokens":50}'

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

Creating ~/.bashrc as a side effect changes persistent user shell state during what should be a read-only environment check. While not directly code execution, it unexpectedly modifies user configuration and can interfere with account setup, auditing expectations, or downstream shell behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.