Back to skill

Security audit

Dockerfile Generator

Security checks for vulnerabilities and agentic risk

Overview

This is a Dockerfile generator, but its implementation can embed untrusted version or port values directly into Dockerfile instructions, which could create unsafe builds.

Review generated Dockerfiles before building them, and only use trusted, simple version and port values. Avoid using this skill in automated pipelines until it validates ports as integers and rejects whitespace or control characters in image tags.

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.yaml:15
Finding

Dockerfile Instruction Injection Through Unsanitized Configuration Values

Content
View full analysis
Remediation
View remediation
65535) { throw new TypeError('Port must be an integer between 1 and 65535'); } return value; } ``` 2. Validate image versions with a conservative allowlist appropriate for supported image tags. At minimum, reject whitespace, newlines, carriage returns, null bytes, and Dockerfile delimiter characters: ```javascript function validateVersion(version, fallback) { const value = version ?? fallback; if ( typeof value !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(value) ) { throw new TypeError('Invalid container image version'); } return value; } ``` 3. Validate values before constructing any template and interpolate only validated results. 4. Prefer explicit allowlists of supported runtime versions and full base-image references where practical. 5. Add tests that verify rejection of values containing `\n`, `\r`, spaces, tabs, null bytes, and injected directives such as `RUN`, `COPY`, and `ONBUILD`. 6. Run downstream container builds in isolated, least-privileged workers. Do not expose credentials or build secrets to untrusted Dockerfiles, restrict build-time network access, and inspect generated Dockerfiles before use in automated pipelines. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger phrase "docker配置" is broad enough to match normal discussion about Docker configuration, which can cause unintended invocation of the skill. In an agent environment, overly generic activation phrases increase the chance that the skill runs on unrelated prompts, potentially producing or suggesting containerization steps the user did not request.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger word "containerize" is ambiguous because it does not specify the expected input, target language, or desired action, making accidental matches more likely. This can lead to incorrect skill activation during general architectural discussions about containers rather than explicit requests to generate a Dockerfile.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger pattern "docker配置" is broad enough to activate on many generic Docker-related requests, not just explicit requests to generate a Dockerfile. Over-broad activation can cause the skill to run outside its intended scope, increasing the chance of unintended assistance or context capture in unrelated conversations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

Natural-language policy review applies to all file types. Presenting the skill description in a fixed language can be a locale-policy concern when no opt-in or justification is provided, especially since the feature list suggests broad applicability across languages.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The trigger list provides only short phrases and no scope constraints, exclusions, or negative examples, so the router may invoke the skill for loosely related containerization requests. This can lead to incorrect tool selection and unintended behavior, even if the implementation itself is not directly malicious.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
67% confidence
Finding

The trigger patterns are defined in Chinese and English only, with no natural-language note about language choice, support, or justification. This can create an implicit language/locale constraint without telling users whether other languages are supported.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.