Back to skill

Security audit

Docker Sandbox

Security checks for vulnerabilities and agentic risk

Overview

This Docker sandbox skill is not malicious, but its shell example weakens the promised isolation by allowing default networking and writable host-mounted files.

Install only if you are comfortable reviewing and tightening the Docker commands before use. Prefer a fresh disposable .sandbox directory, read-only mounts where possible, pinned image digests, --network none by default, CPU/memory/PID limits, dropped capabilities, and non-root execution for shell tests. Do not mount directories containing credentials, source-control metadata, or private data.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:70
Finding
Shell Sandbox Omits Network and Resource Isolation Controls## Vulnerability Details **File Location**: `SKILL.md`, lines 70-81 **Vulnerability Type**: Inconsistent sandbox isolation and unrestricted execution configuration **Risk Level**: High ### Vulnerable Code ```bash ### 3. Bash/Shell Verification Test shell scripts in a generic Alpine environment. ```bash docker run --rm -v "$(pwd)/.sandbox:/app" -w /app alpine sh script.sh ``` ## Security Guidelines 1. **Mount Minimization**: **Never** mount sensitive host directories (e.g., `/etc`, `~/.ssh`, or `/`) into the sandbox. Mount only the specifically designated `.sandbox` or task-related directory. 2. **Network Isolation**: By default, include `--network none` in the command to prevent the code from exfiltrating data or initiating unwanted network requests, unless network access is functionally necessary for the test. 3. **Privileges**: Never use `--privileged` mode or run containers mapped directly to the root user of the host if preventable. ``` ### Technical Analysis The shell verification command executes potentially untrusted scripts without the network and resource restrictions used in the Python and Node.js examples. It omits `--network none`, `--memory`, and `--cpus`, despite the skill claiming that sandboxed execution uses network isolation and hard resource constraints. Docker provides default outbound networking unless networking is explicitly disabled. Consequently, a tested shell script can initiate external connections and transmit information available inside the container. The writable bind mount also exposes the host `.sandbox` directory at `/app`, allowing the script to read, overwrite, delete, or create files in that host-backed directory. The absence of memory, CPU, and process limits also allows a malicious or defective script to consume substantial host resources through the container. The `--rm` option removes the container after execution but does not prevent network access, resource exhaustion, or ...[truncated 1422 chars]
Remediation
## Remediation Suggestions Apply consistent isolation controls to every runtime example. At minimum, update the shell command to include: - `--network none` to disable outbound and inbound container networking by default. - `--memory="512m"` and `--cpus="1.0"` to constrain resource consumption. - `--pids-limit` to mitigate fork bombs and uncontrolled process creation. - `--cap-drop ALL` to remove unnecessary Linux capabilities. - `--security-opt no-new-privileges` to prevent privilege gains inside the container. - A non-root container user where the selected image and task permit it. - A read-only bind mount when the tested script does not need to modify source files. - A size-limited `tmpfs` for temporary writable data rather than a writable host directory. For example: ```bash docker run --rm \ --memory="512m" \ --cpus="1.0" \ --pids-limit="128" \ --network none \ --cap-drop ALL \ --security-opt no-new-privileges \ --read-only \ --tmpfs /tmp:rw,noexec,nosuid,size=64m \ -v "$(pwd)/.sandbox:/app:ro" \ -w /app \ alpine sh script.sh ``` If write access is functionally necessary, mount only a dedicated output directory as writable and validate any resulting files before using them on the host. Document any exception to network isolation explicitly instead of silently relying on Docker's default network.

T08 · Insecure Dependencies

Note
Location
SKILL.md:53
Finding
Sandbox Runtime Images Use Mutable Tags Instead of Immutable Digests## Vulnerability Details **File Location**: `SKILL.md`, lines 53, 67, and 75 **Vulnerability Type**: Mutable container image dependencies **Risk Level**: Low ### Vulnerable Code ```bash docker run --rm \ --memory="512m" \ --cpus="1.0" \ --network none \ -v "$(pwd)/.sandbox:/app" \ -w /app \ python:3.10-slim python main.py ``` ```bash docker run --rm \ --memory="512m" \ --cpus="1.0" \ --network none \ -v "$(pwd)/.sandbox:/app" \ -w /app \ node:18-alpine node main.js ``` ```bash docker run --rm -v "$(pwd)/.sandbox:/app" -w /app alpine sh script.sh ``` ### Technical Analysis The commands identify runtime images using the mutable tags `python:3.10-slim`, `node:18-alpine`, and `alpine`. A tag can be updated to reference different image content without changing the documented command. The effective runtime is therefore not reproducible and may differ from the version that was originally reviewed. If an upstream image changes unexpectedly or its publishing supply chain is compromised, a later invocation may download and execute changed image content. Because container entry points and runtime binaries originate from the selected image, the changed dependency executes before or alongside the tested code. This finding represents dependency-integrity risk. The audited file contains no evidence that the referenced images are currently malicious. ### Attack Path 1. An approved mutable image tag is updated upstream, whether through a routine rebuild, account compromise, registry compromise, or another supply-chain event. 2. A host without the previous image locally, or a workflow that refreshes images, resolves the same tag to the changed image. 3. An agent executes one of the documented `docker run` commands. 4. Docker retrieves and starts the unreviewed image content. 5. Modified runtime components or entry-point behavior execute with access to th ...[truncated 801 chars]
Remediation
## Remediation Suggestions Pin every approved runtime image to an immutable SHA-256 digest while retaining the human-readable tag for clarity: ```bash python:3.10-slim@sha256:<approved-digest> node:18-alpine@sha256:<approved-digest> alpine@sha256:<approved-digest> ``` Obtain digests from a trusted registry, verify image provenance where supported, and record the approved digest in version control. Establish a controlled update process that: 1. Reviews release notes and image provenance. 2. Scans the candidate image for known vulnerabilities. 3. Tests the image in an isolated environment. 4. Updates the pinned digest through a reviewed change. 5. Periodically retires unsupported runtime versions. Where operationally feasible, use an organization-controlled registry mirror or allowlist and enforce signature or attestation verification before execution.
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

Privileged Container / Container Escape

High
Category
Privilege Escalation
Content
1. **Mount Minimization**: **Never** mount sensitive host directories (e.g., `/etc`, `~/.ssh`, or `/`) into the sandbox. Mount only the specifically designated `.sandbox` or task-related directory.
2. **Network Isolation**: By default, include `--network none` in the command to prevent the code from exfiltrating data or initiating unwanted network requests, unless network access is functionally necessary for the test.
3. **Privileges**: Never use `--privileged` mode or run containers mapped directly to the root user of the host if preventable.
Confidence
80% confidence
Finding
Potential security issue detected. Manual review is recommended.

Vague Triggers

Medium
Confidence
86% confidence
Finding
The skill is framed as a generic execution mechanism for broadly testing code, without tight trigger constraints or clear limits on when it should be invoked. In agent environments, overly broad activation language can increase the chance that untrusted or unnecessary code gets executed, expanding the attack surface and normalizing risky behavior.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The guidance promotes bind-mounting a host directory into the container but does not clearly warn that bind mounts allow code in the container to read and modify host files within the mounted path. For a 'secure sandbox' skill, this omission is material because it may give users a false sense of host isolation while still exposing local data and integrity within the mounted directory.

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.

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.

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.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The Bash example weakens the skill’s stated security model by omitting `--network none` and any resource limits, despite presenting Docker execution as a secure sandbox pattern. In a skill meant to execute generated or untrusted code, inconsistent examples are dangerous because users may copy the least secure variant, allowing unnecessary network access and higher abuse potential.

Tool Parameter Abuse

Low
Category
Tool Misuse
Content
Test shell scripts in a generic Alpine environment.

```bash
docker run --rm -v "$(pwd)/.sandbox:/app" -w /app alpine sh script.sh
```

## Security Guidelines
Confidence
84% confidence
Finding
The Bash example bind-mounts a host directory read-write and executes a shell script inside the container without additional hardening. Even with container isolation, untrusted script execution can alter or destroy files in the mounted host path, so this is a real parameter-abuse risk in the context of an execution skill.

Static analysis

No suspicious patterns detected.