T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:577
- Finding
- Unpinned Third-Party Package Execution Through npx## Vulnerability Details **File Location**: `SKILL.md`, line 577 **Vulnerability Type**: Unpinned third-party package execution **Risk Level**: Medium **Vulnerable Code:** ```markdown - **safe-regex** npm package: `npx safe-regex "your-pattern"` — quick single-pattern check ``` ### Technical Analysis The skill recommends executing `safe-regex` through `npx` without specifying a package version, integrity digest, lockfile, or trusted package source. If the package is not already installed locally, `npx` can retrieve and execute the version currently resolved by the configured npm registry. This creates a mutable supply-chain execution path: the code executed when a user follows the recommendation may differ from the code available when the skill was audited. A compromised package release, registry account, registry configuration, or package-resolution environment could therefore cause attacker-controlled code to run. The recommendation is particularly unnecessary because the skill describes itself as a pure static-analysis tool. ### Attack Path 1. An attacker compromises the referenced package, its publisher account, or a registry used by the victim. 2. The attacker publishes or serves a malicious package version. 3. A user follows the skill's recommendation and runs `npx safe-regex "your-pattern"`. 4. `npx` resolves and downloads the unpinned package version. 5. Package runtime code or applicable lifecycle behavior executes with the invoking user's permissions. 6. The malicious code accesses or modifies resources available to that user. ### Impact Assessment Successful exploitation could execute arbitrary code with the privileges of the user running `npx`. The accessible scope may include the audited project, writable files, environment variables, development credentials available to the process, and network resources reachable from the host. The instruction does not itself elevate privileges or establish persistence; i ...[truncated 72 chars]
- Remediation
- ## Remediation Suggestions - Remove the external package-execution recommendation and rely on the skill's local static-analysis implementation. - If the package must be used, specify an audited exact version rather than allowing mutable latest-version resolution. - Install through a committed lockfile with integrity metadata and use a trusted, explicitly configured registry. - Disable dependency lifecycle scripts where compatible with the selected package and workflow. - Verify package provenance, publisher identity, release signatures or attestations, and integrity before execution. - Run third-party analysis tools in an isolated environment with minimal filesystem, credential, and network access.
