T08 · Insecure Dependencies
- Location
SKILL.md:195- Finding
Unpinned Third-Party Package Retrieval and Execution
- Content
View full analysis
# Installed version tree npm outdated # Packages that can be updated npx synp --source-file # yarn.lock ↔ package-lock.json conversion check # Clear cache rm -rf node_modules && npm install ``` ### Technical Analysis The documented debugging workflow instructs the agent to execute `npx tsc` and `npx synp` without requiring an audited, lockfile-pinned local package. If the requested executable is unavailable locally, `npx` may retrieve a package from the configured package registry and execute its code. The effective code executed can therefore depend on mutable external registry content rather than code reviewed as part of this Skill. The `npx tsc` invocation also identifies only a binary name rather than explicitly ensuring that the binary comes from the intended, project-declared `typescript` dependency. The `npx synp` command similarly permits retrieval and execution of an unpinned utility. In addition, `rm -rf node_modules && npm install` deletes the current dependency tree and performs a new installation. Dependency installation can execute package lifecycle scripts such as `preinstall`, `install`, and `postinstall`. If the manifest, lockfile, registry configuration, or a resolved package is malicious or compromised, this operation can cause arbitrary local code execution. ### Attack Path 1. A JavaScript or TypeScript debugging request activates the Skill. 2. The agent follows the technical-stack reference and invokes an `npx` command when the corresponding trusted local executable is absent. 3. `npx` resolves and downloads an unpinned package from the configured pac ...[truncated 1136 chars]- Remediation
View remediation
tsc --version ``` Direct local, lockfile-backed execution remains preferable. 4. Replace general restoration through `npm install` with deterministic lockfile installation where appropriate: ```bash npm ci --ignore-scripts ``` 5. Enable lifecycle scripts only when they are necessary and after reviewing the relevant dependency scripts. Do not automatically run installation commands against untrusted repositories. 6. Require explicit user authorization before deleting `node_modules`, downloading packages, or executing dependency lifecycle scripts. 7. Validate registry configuration and lockfile integrity before installation. Use an approved registry, retain integrity hashes, and incorporate dependency scanning into the workflow. ]]>
