T09 · Insecure Skill Coding Practices
- Location
src/cli.ts:55- Finding
Predictable manifest output follows attacker-controlled symbolic links
- Content
View full analysis
/permission-manifest.json`. It does not use `lstat`, a no-follow file-open option, or another check to establish that an existing output path is a regular file rather than a symbolic link. Node.js `writeFile` follows an existing symbolic link. A malicious Skill can therefore provide `permission-manifest.json` as a symlink to another file writable by the account running the audit. The manifest write then truncates and replaces the symlink target. This write is a documented side effect of the CLI, but following target-controlled symlinks is not necessary for the declared static-analysis functionality and exceeds the minimum safe write privilege. The programmatic `analyzeSkill` API does not itself perform this write; the issue specifically affects the CLI entry point. ### Attack Path 1. An attacker creates a Skill directory containing otherwise reviewable files. 2. The attacker adds a symbolic link named `permission-manifest.json`. 3. The link targets a file writable by the reviewer, such as a user configuration, project file, or shell initialization file. 4. The reviewer invokes `permission-manifest-guard `. 5. Analysis completes and the CLI calls `writeFile` on the predictable output path. 6. The operating system follows the symbolic link, truncating and replacing the target with manifest JSON. The attack does not grant operating-system privilege escalation beyond the audit process's existing identity, but it crosses the intended bo ...[truncated 597 chars]- Remediation
View remediation
