T08 · Insecure Dependencies
- Location
SKILL.md:30- Finding
Unpinned npx Commands May Download and Execute Unreviewed Packages
- Content
View full analysis
&& npx tsc --noEmit 2>&1 ``` ```bash cd && npx type-coverage 2>&1 || echo "type-coverage not installed — skip" ``` ### Technical Analysis The validation instructions invoke `tsc` and `type-coverage` through `npx` without requiring an existing local installation, disabling automatic installation, or pinning the executable to a reviewed package version. Depending on the npm and `npx` version and configuration, `npx` may retrieve a package from the configured npm registry when the requested executable is unavailable locally. The downloaded package can execute installation lifecycle scripts or provide the command that is subsequently run. This means the effective code being executed may not have been present during the skill audit. The `npx tsc` command is also ambiguous because it requests an executable name rather than explicitly verifying that the executable belongs to a lockfile-pinned installation of the official `typescript` package. ### Attack Path 1. An attacker causes the validator to operate on a project that does not contain the expected local `tsc` or `type-coverage` executable. 2. The validator follows the documented command and invokes `npx`. 3. `npx` resolves the missing executable through the configured npm registry. 4. A malicious, compromised, confused, or otherwise unreviewed package is downloaded. 5. Package lifecycle scripts or the resolved executable run under the validator process's user account. 6. The downloaded code can access resources available to that account, including project files and locally exposed credentials. ### Impact Assessment Successful exploitation provides code execution with the operating-system privileges of the user or agent running the validator. The affected scope may include: - Reading, modif ...[truncated 509 chars]- Remediation
View remediation
