T09 · Insecure Skill Coding Practices
- Location
scripts/docker.sh:267- Finding
Generated Compose Services Use Weak Credentials and Unsafe Network Exposure
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Docker helper is not outright malicious, but it should be reviewed because it can generate unsafe Docker Compose configurations and includes an under-disclosed generic workflow script with local history logging.
Review the generated Docker Compose output before using it. Replace all default passwords, avoid publishing databases or admin consoles to every network interface, keep Elasticsearch security enabled, and treat cleanup commands as destructive. Also be aware that the bundled generic script logs command usage under a local docker-helper data directory despite not being part of the advertised Docker helper scope.
scripts/docker.sh:267Generated Compose Services Use Weak Credentials and Unsafe Network Exposure
The skill's declared purpose is narrowly Docker-focused, but the analyzed behavior indicates generic workflow automation, undeclared local data/history handling, and absence of the advertised Docker-specific functions. This mismatch is dangerous because users and orchestrators may trust and invoke the skill under false assumptions, enabling unexpected command execution, data persistence, or broader system interaction than the description implies.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
FROM nginx:1.25-alpine
# Remove default config
RUN rm /etc/nginx/conf.d/default.conf
# Copy custom config
COPY nginx.conf /etc/nginx/nginx.conf
COPY conf.d/ /etc/nginx/conf.d/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
print("\n# .dockerignore (recommended):")
ignore_common = '''node_modules
.git
.env
*.log
.DS_Store
docker-compose*.yml
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
print("\n# .dockerignore (recommended):")
ignore_common = '''node_modules
.git
.env
*.log
.DS_Store
docker-compose*.yml
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
'name': 'GitHub Container Registry',
'login': 'echo $PAT | docker login ghcr.io -u <username> --password-stdin',
'push': '''# 创建PAT (需container权限)
# Settings > Developer settings > Personal access tokens
# 登录
echo $GITHUB_TOKEN | docker login ghcr.io -u <username> --password-stdin
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}''',
'notes': '''注意:
- 需要Personal Access Token(PAT)
- 默认私有, 可设为公开
- 与GitHub仓库关联
- Actions中可用GITHUB_TOKEN'''
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
## 镜像优化要点
- Alpine基础镜像: ~5MB vs Ubuntu ~70MB
- 多阶段构建: 编译与运行分离
- 清理缓存: `apt-get clean && rm -rf /var/lib/apt/lists/*`
- 合并COPY指令
- 使用 `docker image prune` 清理无用镜像
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
## 镜像优化要点
- Alpine基础镜像: ~5MB vs Ubuntu ~70MB
- 多阶段构建: 编译与运行分离
- 清理缓存: `apt-get clean && rm -rf /var/lib/apt/lists/*`
- 合并COPY指令
- 使用 `docker image prune` 清理无用镜像
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
## 镜像优化要点
- Alpine基础镜像: ~5MB vs Ubuntu ~70MB
- 多阶段构建: 编译与运行分离
- 清理缓存: `apt-get clean && rm -rf /var/lib/apt/lists/*`
- 合并COPY指令
- 使用 `docker image prune` 清理无用镜像
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
## 镜像优化要点
- Alpine基础镜像: ~5MB vs Ubuntu ~70MB
- 多阶段构建: 编译与运行分离
- 清理缓存: `apt-get clean && rm -rf /var/lib/apt/lists/*`
- 合并COPY指令
- 使用 `docker image prune` 清理无用镜像
The skill advertises executable commands and static analysis detected shell and network capabilities, but the manifest declares no explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity where an agent may invoke broader capabilities than users expect, increasing the risk of command execution or outbound access without clear consent boundaries.
The phrase "专为中文用户设计,理解中国市场和文化" explicitly frames the skill around a specific language/locale audience. The file does not indicate any user opt-in or alternative language/locale support, so this is a natural-language locale policy concern under the stated rules.
This shell script's user-facing help and command descriptions are presented in Chinese, and the same language choice continues throughout the skill output strings. Because the file does not offer an English/locale option or explain that it is intentionally region-specific, it constitutes a language/locale policy issue under the natural-language policy rule.
Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
USER appuser
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=3s \\
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1
CMD ["python", "app.py"]''',
'java': '''# Java Dockerfile
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
The cheat sheet and debug guidance include destructive cleanup commands such as docker rm -f $(docker ps -aq), docker system prune, and docker system prune -a without adjacent warnings about deleting containers, images, networks, or volumes. In a helper skill context, users may copy-paste these commands directly, increasing the risk of accidental local data loss or service disruption.
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.
The script and help text present a generic developer workflow automation tool rather than a Docker-specific helper, which creates a capability mismatch with the declared skill purpose. In an agent setting, this can mislead users or higher-level orchestration into invoking a broader tool than expected, increasing the risk of inappropriate execution, hidden side effects, and trust-boundary violations.
The inline documentation advertises unrelated project automation features such as init, build, test, deploy, and clean, contradicting the stated Docker-helper intent. This inconsistency is dangerous in a skill ecosystem because users and agents may grant the tool Docker-scoped trust while it exposes a broader operational interface, enabling misuse or unintended workflow actions.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
║ RUN apt-get clean ║
║ ✓ RUN apt-get update && \ ║
║ apt-get install -y --no-install-recommends curl && \ ║
║ apt-get clean && rm -rf /var/lib/apt/lists/* ║
║ ║
║ ── 4. 利用构建缓存 ── ║
║ COPY package.json . ← 先复制依赖文件 ║
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
║ RUN apt-get clean ║
║ ✓ RUN apt-get update && \ ║
║ apt-get install -y --no-install-recommends curl && \ ║
║ apt-get clean && rm -rf /var/lib/apt/lists/* ║
║ ║
║ ── 4. 利用构建缓存 ── ║
║ COPY package.json . ← 先复制依赖文件 ║
No suspicious patterns detected.