Back to skill

Security audit

Docker核心操作指南

Security checks for vulnerabilities and agentic risk

Overview

This Docker guide is not clearly malicious, but its broad trigger text and unsafe Docker examples could lead an agent to run high-impact commands in the wrong context.

Review this skill before installing. Use it only for explicit Docker administration tasks, and require confirmation before running commands that stop, delete, prune, publish ports, mount host paths, or copy files. Do not reuse its sample PostgreSQL password or public port binding outside a disposable local test environment.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:240
Finding

Hardcoded Weak PostgreSQL Credential with Public Port Exposure

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 240–247
Vulnerability Type: Hardcoded weak credential and unsafe network exposure
Risk Level: High

Vulnerable Code:

bash
docker run -d \
  --name postgres \
  -e POSTGRES_PASSWORD=secret \
  -e POSTGRES_DB=mydb \
  -v postgres-data:/var/lib/数据库/data \
  -p 5432:5432 \
  postgres:15

Technical Analysis

The documented workflow initializes PostgreSQL with the predictable password secret. The -p 5432:5432 option publishes the database port on all host interfaces by default rather than restricting access to the loopback interface.

If an agent executes this example on a host whose firewall or cloud security rules permit inbound TCP traffic to port 5432, an attacker can reach the database and attempt authentication using the credential disclosed by the skill. Because POSTGRES_PASSWORD normally configures the password for PostgreSQL's default administrative account, successful authentication could grant extensive control over the database service.

This is an insecure configuration example rather than evidence of an intentionally malicious payload. Nevertheless, an agent following the instructions can create an exploitable service.

Attack Path

  1. A user asks the agent to deploy a PostgreSQL container using the documented workflow.
  2. The agent executes the example with POSTGRES_PASSWORD=secret.
  3. Docker publishes container port 5432 on the host's available interfaces.
  4. A remote attacker identifies the exposed PostgreSQL service by scanning or otherwise discovering the host.
  5. The attacker connects to port 5432 and authenticates using the known default administrative username and documented password.
  6. Subject to PostgreSQL configuration and network controls, the attacker accesses, modifies, or deletes databases managed by the container.

Impact Assessment

Successful exploitation may permit unauthorized admini ...[truncated 555 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove the literal password and require a strong, independently generated secret.
  • Supply credentials through Docker secrets or another managed secret store. If an environment file is necessary for local development, restrict its permissions and exclude it from version control.
  • Bind development-only database access to loopback:
    bash
    -p 127.0.0.1:5432:5432
    
  • Prefer an internal Docker network without publishing the database port when only other containers require access.
  • Add explicit warnings that sample credentials must never be used in production.
  • Restrict inbound access with host firewalls, cloud security groups, and PostgreSQL access-control rules.
  • Rotate the password immediately if this example has already been deployed.
  • Pin the PostgreSQL image to a reviewed immutable digest and maintain a documented image-update process.
  • Require user confirmation before the agent executes a command that publishes a database service.

A safer illustrative workflow is:

bash
docker network create app-internal

docker run -d \
  --name postgres \
  --network app-internal \
  -e POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password \
  -e POSTGRES_DB=mydb \
  -v postgres-data:/var/lib/postgresql/data \
  --secret postgres_password \
  postgres@sha256:<reviewed-image-digest>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (18)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill description claims the skill should be used for data analysis/reporting/visualization, but the body actually provides Docker operational commands with exec, write, and read capabilities. This mismatch can cause the agent to invoke a shell-capable infrastructure skill in unrelated contexts, expanding the chance of unintended command execution or unsafe file/system operations. The broad mismatch makes the skill more dangerous because its available tools can affect the host environment, not just generate text.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The invocation phrase is overly broad and mismatched to the actual functionality, which can trigger this Docker/exec-capable skill for unrelated user requests. If auto-selected by an agent, the skill may introduce inappropriate operational guidance or lead to shell command suggestions/execution in contexts where the user only asked for analytics, creating a real misuse and safety boundary problem.

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.

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.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The examples include destructive cleanup and deletion commands like docker rm -f and docker container prune without immediate, prominent warnings beside those commands. In an agent skill, users may copy or the agent may surface these commands directly, causing accidental data loss or service disruption if applied to the wrong environment. The Docker-operations context increases danger because these commands act on real local resources.

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.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide includes irreversible image and system cleanup commands such as docker image prune -a and docker system prune --volumes without consistent warnings at the point of use. These commands can remove images, stopped containers, networks, and volumes that users still need, producing operational outages or data loss when copied blindly from a skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The description states '支持中文交互,无需复杂配置即开即用', and the document is entirely oriented around Chinese output without an explicit language choice. This can be a natural-language policy concern if the skill defaults to a specific language rather than offering locale selection or opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.