Back to skill

Security audit

peen

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent purpose, but it should be reviewed because it gives broad Docker and network command authority around a credential-bearing durable agent server.

Install only for a dedicated project workspace. Do not mount your home directory, SSH keys, Docker socket, or directories containing secrets. Review any `.env`, `AGENTS.md`, and `.agents/**` changes before use, run Docker in an isolated/rootless setup where possible, and expose Peen only with a real API token and TLS outside a trusted local environment.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:13
Finding
Overly Broad Docker and Network Shell Permissions## Vulnerability Details **File Location**: `SKILL.md`, lines 13–16 **Vulnerability Type**: Excessive shell permissions that violate least privilege **Risk Level**: High ### Vulnerable Code ```yaml shell: - "docker build *" - "docker run *" - "curl *" ``` ### Technical Analysis The skill grants unrestricted argument wildcards to `docker build`, `docker run`, and `curl`. These permissions are substantially broader than the documented workflow, which only requires building the Peen image, starting it with specific mounts and port mappings, and querying known local API endpoints. In particular, `docker run *` allows arbitrary Docker runtime options rather than constraining the image, mount sources, capabilities, network settings, or privilege flags. Depending on the host's Docker authorization model, this could permit sensitive host directories to be mounted into a container or a container to be launched with elevated privileges. Similarly, `curl *` permits requests to arbitrary destinations with arbitrary supported options. An agent could use it to communicate with external systems or transmit data obtained from accessible files, tool output, or Docker-mounted paths. The combination creates a particularly dangerous capability chain: Docker can expand access to host resources, while curl can provide an outbound exfiltration channel. ### Attack Path 1. An attacker manipulates the agent's instructions, or the agent mistakenly constructs a command outside the intended workflow. 2. The agent invokes the permitted `docker run` command with attacker-selected arguments. 3. The command mounts a sensitive host path into a container or requests elevated container permissions, subject to the Docker daemon's effective privileges and security policy. 4. The container reads data from the newly exposed host resource. 5. The agent invokes the unrestricted `curl` permission to send the obtained data to an attacker-controlled ...[truncated 751 chars]
Remediation
## Remediation Suggestions 1. Replace wildcard shell permissions with narrowly scoped wrapper scripts or exact command templates. 2. Restrict Docker execution to the approved Peen image and explicitly allow only the required flags, port mapping, environment file, and workspace/state mounts. 3. Explicitly deny dangerous Docker options, including `--privileged`, arbitrary `--mount` or `-v` sources, host namespaces, added capabilities, device access, Docker socket mounts, and unapproved images or entrypoints. 4. Restrict curl to approved localhost Peen API endpoints, expected HTTP methods, and required headers. Disallow arbitrary URLs, proxy settings, file uploads, redirects to external hosts, and options that read request data from files. 5. Require explicit operator approval for any Docker or network command that differs from the documented setup. 6. Apply defense-in-depth controls outside the skill: use a rootless or tightly isolated Docker environment, restrict outbound network access, avoid exposing the Docker socket, and mount only the intended workspace and state directories. 7. Separate image-building, server-starting, and API-query permissions so each operation receives only the capabilities it requires.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (8)

Credential Access

High
Category
Privilege Escalation
Content
- "docs/**"
      - ".env.example"
    write:
      - ".env"
      - "AGENTS.md"
      - ".agents/**"
  shell:
Confidence
88% confidence
Finding
The skill explicitly grants write access to `.env`, which commonly stores provider credentials, and the skill later discusses keeping provider credentials there. Because the same skill warns that the workspace should be treated as direct shell/filesystem access for the model, allowing modification of `.env` creates a real risk of credential tampering, exfiltration setup, or service redirection.

Credential Access

High
Category
Privilege Escalation
Content
sudo chown 10001:10001 ./data/peen ./workspace

docker run --rm \
  --env-file .env \
  -p 8080:8080 \
  -v "$(pwd)/data/peen:/data/peen" \
  -v "$(pwd)/workspace:/workspace" \
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
sudo chown 10001:10001 ./data/peen ./workspace

docker run --rm \
  --env-file .env \
  -p 8080:8080 \
  -v "$(pwd)/data/peen:/data/peen" \
  -v "$(pwd)/workspace:/workspace" \
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

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
86% confidence
Finding
The example runs `docker run ... peen run` without pinning the image to a specific tag or digest. If `peen` resolves to a mutable local or remote image reference, operators may unknowingly run an unexpected or compromised image, creating a supply-chain risk in a tool that already has workspace and secret exposure.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
make docker-build
mkdir -p ./data/peen ./workspace
sudo chown 10001:10001 ./data/peen ./workspace

docker run --rm \
  --env-file .env \
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
make docker-build
mkdir -p ./data/peen ./workspace
sudo chown 10001:10001 ./data/peen ./workspace

docker run --rm \
  --env-file .env \
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

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.

Static analysis

No suspicious patterns detected.