T09 · Insecure Skill Coding Practices
- Location
SKILL.md:104- Finding
Mandatory Verification Executes Repository-Controlled npm Test Scripts
- Content
View full analysis
r.exitCode !== 0)) { throw new Error('Verification failed. Fix errors before claiming done.') } return true } ``` ### Technical Analysis The skill mandates running `npm test` whenever a target project contains `package.json`. An npm test command executes the repository-defined `scripts.test` entry and can also trigger associated npm lifecycle scripts. Those entries are controlled by the target repository rather than by this skill. The documented implementation performs no trust assessment, script inspection, command preview, user confirmation, sandboxing, network restriction, or environment-variable filtering before execution. Because verification is described as mandatory before reporting completion, the design encourages automatic execution even when the repository originated from an untrusted party. The same vulnerable example appears in both the root and packaged copies of `SKILL.md`. ### Attack Path 1. An attacker creates or modifies a repository containing a malicious `package.json`. 2. The attacker defines a `test`, `pretest`, or `posttest` script that executes arbitrary shell commands. 3. A user asks Clawder to inspect, fix, or refactor that repository. 4. Clawder follow ...[truncated 1018 chars]- Remediation
View remediation
