T09 · Insecure Skill Coding Practices
- Location
SKILL.md:28- Finding
Command Injection Through Unvalidated Deployment Parameters
- Content
View full analysis
docker build -t <镜像仓库地址>:<镜像标签> -f . docker push <镜像仓库地址>:<镜像标签> ``` The same pattern is used for operations on the remote server: ```bash cd <服务器部署目录> docker pull <镜像仓库地址>:<镜像标签> docker stop tpaip-server && docker rm tpaip-server docker run -d \ --name tpaip-server \ --restart unless-stopped \ -p 8080:8080 \ --env-file .env \ -v ./data:/app/data \ <镜像仓库地址>:<镜像标签> ``` ### Technical Analysis The skill treats user-supplied deployment information as command fragments without specifying any validation, canonicalization, shell escaping, or safe argument-passing requirements. Values such as the project directory, Dockerfile path, image repository, image tag, remote deployment directory, environment-file path, volume mappings, and additional container parameters can therefore cross a command boundary when interpreted by a shell. For example, if a deployment directory or image-tag value contains shell metacharacters such as a semicolon, command substitution, a newline, or a logical operator, an agent that follows the documented template by constructing a shell command may execute the injected expression as a separate command. Quoting alone would not be sufficient unless it is implemented consistently and appropriate to the shell. The safer design is to avoid constructing shell command strings and instead invoke processes with explicit argument arrays after validating each value against its ex ...[truncated 2434 chars]- Remediation
View remediation
