T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Command Injection Through Unsanitized Cocos Project Name
- Content
View full analysis
` to generate the project structure. ``` ### Technical Analysis The skill instructs the agent to obtain a project name from the user and interpolate it into a command executed through the `exec` tool. It does not require validation, shell escaping, path normalization, or structured argument-array execution. If the execution environment passes the resulting string to a command shell, shell metacharacters in the project name may be interpreted as additional commands, redirections, substitutions, or pipelines instead of as literal project-name characters. Merely consulting `cocos create --help` does not mitigate this issue because it validates CLI syntax rather than the safety of user-controlled input. This is an insecure skill coding practice because the skill establishes a direct path from untrusted input to an operating-system command without defining a trust boundary or sanitization controls. ### Attack Path 1. An attacker asks the agent to create a Cocos project. 2. The agent requests the project name as required by the skill. 3. The attacker supplies a name containing shell-control syntax, conceptually such as `valid-name; `. 4. The agent substitutes that value into the documented command: ```text cocos create ``` 5. If `exec` uses a shell-backed command string, the shell parses the injected syntax. 6. The attacker-controlled command executes with the same operating-system identity, en ...[truncated 913 chars]- Remediation
View remediation
