T08 · Insecure Dependencies
Error
- Location
- SKILL.md:26
- Finding
- Unpinned Remote Runtime Package Is Automatically Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:26-31`, `SKILL.md:88-92` **Vulnerability Type**: Unpinned package execution through `npx` **Risk Level**: High ### Vulnerable Code ```markdown **Agent Execution Instructions**: 1. Determine this SKILL.md file's directory path as `{baseDir}` 2. Script path = `{baseDir}/scripts/<script-name>.ts` 3. Replace all `{baseDir}` in this document with the actual path 4. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun ``` ```bash ${BUN_X} {baseDir}/scripts/check-permissions.ts ``` ### Technical Analysis When Bun is unavailable, the instructions direct the agent to run `npx -y bun`. No package version or integrity digest is specified. Consequently, `npx` may retrieve the currently published `bun` package and execute its package entry point with the permissions of the invoking user. The effective runtime payload can therefore change after the Skill has been reviewed. The local lockfile does not mitigate this behavior because it only locks the vendored `baoyu-chrome-cdp` dependency and does not pin the package selected by the standalone `npx -y bun` command. This is an unsafe supply-chain execution path. Exploitation depends on compromise or malicious control of the resolved registry package, registry configuration, network resolution, or package source. ### Attack Path 1. Bun is not installed, but `npx` is available. 2. The agent follows the Skill instruction and resolves `${BUN_X}` to `npx -y bun`. 3. `npx` queries the configured package registry for the unpinned `bun` package. 4. A compromised package, registry, mirror, or resolution path supplies attacker-controlled code. 5. `npx` downloads and executes that code without an interactive installation confirmation because of `-y`. 6. The payload runs with the same filesystem, network, environment-variable, and process privileges as the agent. ### Impact Assessment Successful exploi ...[truncated 401 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not automatically execute an unversioned package through `npx -y`. 2. Require a preinstalled, trusted Bun executable and fail safely when it is unavailable. 3. If automatic acquisition is unavoidable, pin an audited version rather than resolving the latest release. 4. Verify the downloaded artifact using a trusted cryptographic digest or signed release mechanism. 5. Pin the package registry to a trusted source and document the expected package provenance. 6. Avoid `-y` for security-sensitive runtime installation so the user can review the package and version. 7. Prefer distributing the scripts in a form executable by an already trusted local runtime. ]]>
