Back to skill

Security audit

Container Debug

Security checks for vulnerabilities and agentic risk

Overview

This Docker debugging skill is not malicious, but it includes powerful container access and cleanup commands that deserve review before use.

Install only if you are comfortable letting the agent advise on Docker operations. Require explicit approval before running nsenter, namespace-sharing debug containers, tcpdump sidecars, root exec, or any docker prune command; pin and verify helper images before use, and avoid these commands on production or sensitive containers unless an authorized operator has reviewed the exact command.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:127
Finding

Unpinned Third-Party Debug Images Execute Mutable External Content

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:127, SKILL.md:172, and SKILL.md:206-209
Vulnerability Type: Supply-chain exposure through unpinned container images
Risk Level: Medium

Vulnerable code snippets:

bash
# Attach a debug container to the same namespace
docker run -it --pid=container:my-container --net=container:my-container busybox sh
bash
# If curl/ping not available in container, install or use a debug container:
docker run --rm --network container:my-container curlimages/curl curl -s http://localhost:8080
bash
# If tcpdump not available, use a sidecar
docker run --rm --net=container:my-container nicolaka/netshoot tcpdump -i eth0 -n

# netshoot has: tcpdump, curl, nslookup, netstat, iperf, etc.
docker run --rm --net=container:my-container nicolaka/netshoot bash

Technical Analysis

The documented commands run third-party images without pinning them to reviewed, immutable SHA-256 digests. An unqualified image such as busybox, curlimages/curl, or nicolaka/netshoot normally resolves to a mutable tag. Consequently, the image content executed by a future user may differ from the content reviewed when the Skill was published.

This is especially sensitive because these debug images are attached directly to a target container's network namespace, and in one case its PID namespace. Code in a compromised image could inspect network traffic, connect to internal services reachable by the target container, enumerate processes, or interfere with processes where namespace permissions permit. The issue is a supply-chain weakness rather than evidence that the currently referenced projects are malicious.

Attack Path

  1. An attacker compromises an upstream image publisher, registry account, build pipeline, or mutable image tag.
  2. The attacker publishes a modified image under one of the image references used by the Skill.
  3. An operator follows the document ...[truncated 1232 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin every debugging image to a reviewed immutable digest, for example:
    bash
    docker run --rm \
      --net=container:my-container \
      registry.example/netshoot@sha256:<reviewed-digest> \
      tcpdump -i eth0 -n
    
  • Specify the complete trusted registry and repository name rather than relying on implicit registry resolution.
  • Verify image signatures and provenance with an approved mechanism such as Docker Content Trust, Notary, or Sigstore/Cosign.
  • Maintain an allowlist of approved debugging images and periodically scan them for vulnerabilities and unexpected changes.
  • Prefer internally mirrored images whose digests are controlled and reviewed by the organization.
  • Apply least privilege: use network or PID namespace sharing only when required, run with a non-root user where practical, drop unnecessary capabilities, use a read-only root filesystem, and apply seccomp/AppArmor/SELinux restrictions.
  • Explain the security implications immediately beside each namespace-sharing command so operators can make an informed decision before execution.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (19)

Privileged Container / Container Escape

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The nsenter -t $PID -m -u -i -n -p -- /bin/sh example enters all major namespaces of the target container process, effectively bypassing normal container isolation boundaries for deep host-level inspection. In practice this is a privileged debugging technique that can expose sensitive data, alter process state, and materially increase the risk of container escape or host compromise if used on untrusted workloads or by over-privileged operators.

Content

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

md
# Use docker cp to extract files
docker cp my-container:/app/config.json ./

# Use nsenter to get a shell in the container's namespace (Linux)
PID=$(docker inspect --format='{{.State.Pid}}' my-container)
nsenter -t $PID -m -u -i -n -p -- /bin/sh

Privileged Container / Container Escape

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The debug container example joins the target container's PID and network namespaces using --pid=container:my-container --net=container:my-container, giving the helper container deep visibility into process and network activity. While useful for diagnostics, it materially reduces isolation and can expose credentials, traffic, and runtime state, especially when combined with unpinned helper images.

Content

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

md
# Use nsenter to get a shell in the container's namespace (Linux)
PID=$(docker inspect --format='{{.State.Pid}}' my-container)
nsenter -t $PID -m -u -i -n -p -- /bin/sh

# Attach a debug container to the same namespace
docker run -it --pid=container:my-container --net=container:my-container busybox sh

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.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The example runs busybox sh without pinning the image to a specific tag or digest. Pulling an unpinned image can lead to non-reproducible behavior and exposes users to unexpected upstream image changes, including compromised or malicious image updates.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The command uses curlimages/curl without a tag or digest. In a debugging skill, users may run this directly, causing Docker to pull the latest available image, which can change over time or be replaced with a compromised version.

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.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The command pulls postgres without a tag or digest, which defaults to a floating tag and may change unexpectedly. This can introduce supply-chain risk and inconsistent debugging results across environments.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The example uses nicolaka/netshoot without a tag or digest. Because this is a network-debug sidecar likely to be run verbatim, users may pull an unintended or changed image version with powerful networking utilities installed.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This command also uses nicolaka/netshoot without a fixed tag or digest. Since the image is intended to inspect container networking, an unpinned pull increases supply-chain risk in a context where the helper container may access sensitive network data.

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.

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.

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.

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.

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.

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.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is framed as a debugging guide but includes cleanup commands like docker system prune -a and volume deletion, which can destroy images, caches, networks, and persistent data. In an agent skill context, including destructive operations broadens the blast radius beyond debugging and creates risk of accidental service disruption or data loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Several prune commands are destructive and can remove stopped containers, unused images, networks, caches, and volumes, yet only one command includes an explicit warning. In a reusable skill, insufficient warning increases the chance that a user or agent invokes these commands in the wrong environment and causes avoidable outages or data loss.

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.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest centers on debugging running Docker containers and Compose services, yet the document includes operational workflows like starting stopped containers, running new containers with overridden entrypoints, creating networks, and building images. Some of this supports debugging, but it expands beyond the narrow 'running containers' description stated in the manifest.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.