T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:26
- Finding
- Unpinned Remote Package Retrieval and Execution Through npx## Vulnerability Details **File Location**: `SKILL.md`, line 26 **Vulnerability Type**: Unsafe execution of an unpinned third-party dependency **Risk Level**: Medium ### Vulnerable Code ```text 4. Determine the `${BUN_X}` runtime: if `bun` is installed, use `bun`; if `npx` is available, use `npx -y bun`; otherwise, prompt the user to install bun ``` The fallback command is subsequently used to execute the Skill script: ```bash ${BUN_X} {baseDir}/scripts/weibo-hot-search.ts ``` ### Technical Analysis The instruction `npx -y bun` permits npm to resolve, download, and execute the package identified by the mutable name `bun`. No package version, integrity hash, lockfile, trusted registry configuration, or prior review is required. The `-y` option suppresses the normal confirmation prompt, so package retrieval and execution occur automatically. Consequently, the effective code executed by the Agent can differ from the code that existed when the Skill was reviewed. A compromised upstream release, registry account, package-resolution configuration, or package dependency could introduce arbitrary code. The repository itself contains no `scripts/` directory or dependency lockfile, so the expected runtime and script execution chain cannot be independently verified from the audited artifact. ### Attack Path 1. The target environment does not have a trusted `bun` executable installed. 2. The Agent detects that `npx` is available and follows the documented fallback. 3. The Agent invokes `npx -y bun` without a version or integrity constraint. 4. npm resolves and downloads the package and its dependency graph from the configured registry. 5. Package-controlled code executes with the same operating-system identity and environment as the Agent. 6. If the resolved package or one of its dependencies is compromised, it can read or modify files accessible to the Agent, access inherited environment variables, initiate network conn ...[truncated 509 chars]
- Remediation
- ## Remediation Suggestions - Remove the automatic `npx -y bun` fallback and require a separately installed, trusted Bun executable. - If package-based installation is necessary, pin an explicitly reviewed version rather than resolving the latest release. - Verify downloaded artifacts using a trusted cryptographic checksum or signature. - Use a controlled package registry and a committed lockfile where applicable. - Do not suppress installation confirmation for code that will execute locally. - Validate the resolved executable path and version before invocation. - Run the Skill under a minimally privileged account with restricted filesystem, environment-variable, and network access. - Include the referenced script and dependency metadata in the distributed artifact so the full execution chain can be audited.
