T09 · Insecure Skill Coding Practices
- Location
scripts/eye.sh:8- Finding
Execution of Untrusted JavaScript Outside the Skill Directory
- Content
View full analysis
/scripts/eye.sh`. Starting from the `scripts` directory and traversing three parent directories causes `PROJECT_ROOT` to resolve outside the installed Skill directory. For the audited artifact path, it resolves to `/tmp`, making `SERVER` equal to `/tmp/server.js`. The package does not contain the documented `server.js`. Consequently, the launcher does not execute a reviewed, package-controlled server. Instead, it executes whichever file is present at the external path. Shared temporary directories such as `/tmp` are commonly writable by unprivileged local users and processes, making this an unsafe trust-boundary violation. This behavior is not required for the declared glyph-viewer functionality and exceeds minimum privilege by allowing code outside the Skill package to inherit the invoking user's execution context. ### Attack Path 1. An attacker or compromised local process creates `/tmp/server.js`. 2. The file contains attacker-controlled Node.js code. 3. A user or Agent invokes: ```bash ./scripts/eye.sh start ``` 4. The wrapper computes `SERVER=/tmp/server.js`. 5. Node.js executes the attacker-controlled file with the permissions and environment of the invoking user. 6. The payload can access user-readable files, inherited environment variables, local services, and available network resources. ### Impact Assessment Successful exploitation provides arbitrary co ...[truncated 514 chars]- Remediation
View remediation
&2 exit 1 fi ``` 4. Canonicalize the server path and verify that it remains beneath the canonical Skill root. 5. Do not search shared temporary directories or parent projects for executable code. 6. Consider validating the packaged server against a signed manifest or expected cryptographic hash. 7. Add installation and CI tests that confirm all documented runtime files are included and that no executable path escapes the package. ]]>
