Back to skill

Security audit

Deploy Agent

Security checks for vulnerabilities and agentic risk

Overview

This Docker deployment skill is coherent, but it needs Review because it can make host-level Docker changes and run or manage containers without enough scoping checks.

Install only if you are comfortable giving the agent Docker-admin-level authority on the host. Avoid using it on untrusted uploaded archives, repositories, or Compose files unless you manually inspect them first, and treat install-docker as a privileged system change rather than a normal deployment step.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/deploy-agent.sh:122
Finding

Untrusted Docker Compose Files Can Request Host-Level Privileges

Content
View full analysis
/dev/null || true docker compose -f "$compose_file" -p "$name" up -d --build 2>&1 | while IFS= read -r line; do echo " $line"; done local status=${PIPESTATUS[0]} ``` ### Technical Analysis The deployment workflow automatically discovers and executes a project-controlled Docker Compose file. It does not inspect the resolved Compose configuration, enforce a security policy, or ask the user to approve requested privileges. A Compose file can request security-sensitive Docker capabilities, including: - `privileged: true` - Host PID, IPC, or network namespaces - Arbitrary Linux capabilities - Host devices - Bind mounts of `/`, `/etc`, user home directories, or other sensitive paths - A bind mount of `/var/run/docker.sock` - Changes to seccomp or AppArmor protections Because the documented workflow explicitly supports uploaded or otherwise externally supplied projects, an attacker-controlled project can place these directives in a Compose file. Docker daemon access is effectively host-administrative in many environments, so merely placing the workload inside a container does not establish an adequate security boundary. ### Attack Path 1. An attacker supplies a project containing `compose.yml` or another supported Compose filename. 2. The Compose file defines a service with a dangerous setting, such as `privileged: true`, a mount of the ho ...[truncated 967 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/deploy-agent.sh:225
Finding

Container Management Commands Are Not Restricted to Deploy-Agent Resources

Content
View full analysis
" require_docker || exit 1 echo "━━━ Deploy-Agent: Stopping Container ━━━━━" docker stop "$target" 2>/dev/null || warn "Container '$target' not running" docker rm "$target" 2>/dev/null || true ok "Container '$target' stopped and removed" } # ── Logs ── cmd_logs() { local target="${1:-}" [ -z "$target" ] && die "Usage: deploy-agent.sh logs " require_docker || exit 1 docker logs -f --tail 50 "$target" } ``` ### Technical Analysis The skill identifies its own containers with the `deploy-agent.managed=true` label, but the `stop` and `logs` commands do not verify that the supplied target has this label. The target can be any Docker container name or ID visible to the current Docker daemon. Consequently: - `stop` can stop and permanently remove an unrelated container. - `logs` can expose output from unrelated workloads. - The implementation violates the documented managed-container boundary. Quoting the target prevents shell command injection, but it does not provide authorization. The vulnerability is therefore an object-level access-control failure rather than a shell injection issue. ### Attack Path 1. An attacker or untrusted caller identifies or guesses the name or ID of an unrelated container. 2. The caller invokes `deploy-agent.sh logs ` to access its recent and future log output, or invokes `deploy-agent.sh stop `. 3. The script confirms only that Docker is available. 4. It passes the target directly to `docker logs`, `docker stop`, and `docker rm`. 5. The unrelated container's logs are disclosed, or the workload is stopped and deleted. ### Im ...[truncated 485 chars]
Remediation
View remediation
/dev/null)" || die "Container not found" [ "$managed" = "true" ] || die "Refusing to manage an unowned container" ``` 2. Perform the ownership check immediately before each sensitive Docker operation to reduce time-of-check/time-of-use risk. 3. Optionally verify both the management label and a skill-specific deployment identifier. 4. Use distinct administrative commands for host-wide container operations and require explicit user confirmation for those commands. 5. Do not report successful removal unless `docker stop` and `docker rm` actually succeeded. 6. Document that container IDs and names alone are identifiers, not proof that a resource belongs to the deploy agent. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/deploy-agent.sh:209
Finding

Status Command Discloses Unrelated Host Container Metadata

Content
View full analysis
/dev/null) if [ -z "$containers" ]; then echo " No managed containers." echo "" echo " All running containers:" docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}" 2>/dev/null || true else echo "$containers" ``` ### Technical Analysis The command initially applies the correct `deploy-agent.managed=true` filter. However, when no matching containers are found, it automatically falls back to an unrestricted `docker ps`. This changes the command's scope from deploy-agent-managed resources to all running containers without separate authorization or an explicit host-wide listing request. The resulting output includes container names, image names, status data, and published ports. ### Attack Path 1. The Docker host has no containers labeled `deploy-agent.managed=true`. 2. The host has one or more unrelated running containers. 3. A caller invokes `deploy-agent.sh status`. 4. The filtered query returns no managed containers. 5. The fallback executes unrestricted `docker ps`. 6. Metadata for unrelated workloads is returned to the caller. ### Impact Assessment The output can reveal application and infrastructure names, software images and versions, service topology, operational status, and externally exposed ports. This information can support subsequent targeting or disclose confidential deployment details. The scope is limited to container metadata available from `docker ps`; this code does not directly reveal container environment variables or filesystem contents. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate-dockerfile.sh:7
Finding

Unvalidated Port Argument Permits Dockerfile Instruction Injection

Content
View full analysis
"$GENERATED_FILE" <<- DOCKERFILE # ── Deploy-Agent: Node.js ── FROM node:20-alpine WORKDIR /app COPY package*.json ./ RUN npm ci --only=production 2>/dev/null || npm install --production COPY . . ENV NODE_ENV=production ENV PORT=${PORT} EXPOSE ${PORT} HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\ CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT}/ || exit 1 CMD ["node", "server.js"] DOCKERFILE ``` Equivalent interpolation is used in the Python, Go, and Rust Dockerfile generation branches. ### Technical Analysis `PORT` is accepted without checking that it is a valid decimal TCP port. Because it is expanded into an unquoted heredoc, a value containing newline characters can terminate the current Dockerfile instruction and introduce additional instructions. For example, a direct caller could supply a conceptual value of: ```text 3000 RUN ``` The generated Dockerfile would then contain a new `RUN` instruction. If that Dockerfile is subsequently built, the injected command executes inside the image build environment. Shell quoting at script invocation does not make the generated Dockerfile safe because newline characters remain part of the expanded variable. Validation must occur before content generation. ### Attack Path 1. An attacker gains control of the third argument passed directly to `generate-dockerfile.sh`, or another caller forwards an untrusted port value. 2. T ...[truncated 996 chars]
Remediation
View remediation
= 1 && PORT <= 65535 )) || { echo "[✗] Port must be between 1 and 65535" exit 1 } ``` 2. Explicitly reject carriage returns, line feeds, spaces, and all non-decimal characters. 3. Apply the same validation in `deploy-agent.sh` before using a caller-supplied deployment port in Docker arguments. 4. Treat auto-detected values as untrusted as well, even if current detection normally emits hardcoded or numeric values. 5. Prefer structured template generation with narrowly typed values instead of unrestricted shell interpolation. 6. Add regression tests using multiline strings, command substitutions, whitespace, negative numbers, zero, and values above 65535. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (35)

Chaining Abuse

High
Category
Tool Misuse
Confidence
82% confidence
Finding

The skill combines privileged host setup, filesystem writes, network access, Docker builds, and container execution in one workflow, creating a strong chaining surface. An attacker can supply a malicious project or archive that gets detected, written, built, and run, while the skill normalizes elevated host actions, making abuse substantially more dangerous than a simple single-purpose skill.

Content

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

md
| 权限 | 范围 | 用途 | 说明 |
|------|------|------|------|
| 执行 | sudo | Docker 安装、用户组管理 | `bootstrap-docker.sh` 安装 Docker |
| 执行 | docker | 容器管理 | 构建、运行、停止容器 |
| 文件系统 | 读取 | 项目目录 | 检测项目类型、读取构建配置 |
| 文件系统 | 写入 | 项目目录 | 生成 Dockerfile |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bootstrap-docker.sh (reported line 16)May include surrounding context.

sh
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bootstrap-docker.sh (reported line 17)May include surrounding context.

sh
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bootstrap-docker.sh (reported line 18)May include surrounding context.

sh
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/bootstrap-docker.sh (reported line 20)May include surrounding context.

sh
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/bootstrap-docker.sh (reported line 20)May include surrounding context.

sh
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update -qq
sudo apt-get install -y -qq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill tells the agent to extract user-provided zip/tar archives but provides no safeguards for archive traversal, symlink abuse, overwrite risks, or extraction into sensitive locations. Because uploaded archives are untrusted input, this can lead to arbitrary filesystem writes or planting files that later influence builds or execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The cleanup example force-removes all containers with the managed label using 'docker rm -f' without an explicit destructive-action warning or confirmation step. If labels are broad or misapplied, this can cause accidental service disruption and data loss for running workloads.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
84% confidence
Finding

The permissions table explicitly declares sudo execution for Docker installation and user/group management. In the context of an agent skill that may act on user prompts, advertising privileged execution broadens the trust boundary and increases the risk of host compromise if the workflow is misused or chained with untrusted project content.

Content

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

md
| 权限 | 范围 | 用途 | 说明 |
|------|------|------|------|
| 执行 | sudo | Docker 安装、用户组管理 | `bootstrap-docker.sh` 安装 Docker |
| 执行 | docker | 容器管理 | 构建、运行、停止容器 |
| 文件系统 | 读取 | 项目目录 | 检测项目类型、读取构建配置 |
| 文件系统 | 写入 | 项目目录 | 生成 Dockerfile |

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 120)May include surrounding context.

md
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 164)May include surrounding context.

md
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/bootstrap-docker.sh (reported line 13)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/bootstrap-docker.sh (reported line 14)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/bootstrap-docker.sh (reported line 16)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/bootstrap-docker.sh (reported line 17)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/bootstrap-docker.sh (reported line 18)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/bootstrap-docker.sh (reported line 20)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/bootstrap-docker.sh (reported line 22)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/bootstrap-docker.sh (reported line 26)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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 · scripts/deploy-agent.sh (reported line 42)May include surrounding context.

sh
fi

echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings

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/bootstrap-docker.sh (reported line 14)May include surrounding context.

sh
echo "[*] Installing Docker Engine..."
sudo apt-get update -qq
sudo apt-get install -y -qq ca-certificates curl

sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
96% confidence
Finding

Adding the current user to the docker group is security-sensitive because membership effectively grants root-equivalent access on the host through the Docker daemon. A user in this group can mount the host filesystem, start privileged containers, and escape normal local privilege boundaries.

Content

Scanner excerpt · scripts/bootstrap-docker.sh (reported line 23)May include surrounding context.

sh
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update -qq
sudo apt-get install -y -qq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Add current user to docker group (avoid sudo)
sudo usermod -aG docker "$(whoami)" 2>/dev/null || true

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The install-docker command invokes a bootstrap script that performs major host-level changes, but the wrapper presents it as a normal subcommand without a strong warning, confirmation, or dry-run behavior. In a skill/agent setting, this increases the risk of unexpected privileged system modification on the host machine.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The deploy flow automatically stops and removes any existing container with the same derived name before starting a new one, without prompting the user or requiring a force flag. In an agent/automation context, this can unexpectedly terminate workloads and destroy container state, especially if naming collisions occur or the target directory name is ambiguous.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.