T08 · Insecure Dependencies
- Location
SKILL.md:22- Finding
Unpinned npm Package Is Automatically Downloaded and Executed
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 22
Vulnerability Type: Supply-chain risk caused by unpinned remote package execution
Risk Level: HighVulnerable Code
md **Agent Execution**: Determine this SKILL.md directory as `{baseDir}`, then use `{baseDir}/scripts/<name>.ts`. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun.Technical Analysis
The fallback command
npx -y buninstructs the Agent to resolve a package from the npm registry, download it, and execute its binary without interactive approval. No version, lockfile, integrity hash, or trusted package source is specified.Consequently, the executable payload can change after the Skill has been audited. A malicious package release, compromised maintainer account, registry compromise, or unexpected dependency update could cause arbitrary code to run under the Agent user's account.
The
-yoption suppresses the normal installation confirmation, further reducing the opportunity for the user to review the resolved package and version. This behavior is unnecessary when a trusted Bun installation can instead be required as an explicit prerequisite. It is particularly concerning because the audited artifact does not contain the referencedscripts/directory, meaning the downloaded runtime cannot successfully execute the declared local scripts as packaged.Attack Path
- An attacker compromises the npm package, its maintainer account, or a dependency included in a future package release.
- A system without a locally installed
bunbinary loads the Skill. - The Skill selects the documented
npx -y bunfallback. npxresolves and downloads the current package from the registry without asking for confirmation.- The package binary or associated installation code executes with the permissions of the Agent process.
- Malicious code can access f ...[truncated 832 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the automatic
npx -y bunfallback and require a separately installed, trusted Bun runtime. - If automatic installation is unavoidable, pin an audited exact version rather than resolving the latest release.
- Use a lockfile and verify package integrity hashes before execution.
- Require explicit user confirmation before downloading or executing any package.
- Obtain packages only from an organization-controlled or otherwise explicitly trusted registry.
- Document the expected package name, version, publisher, and integrity value so the Agent can validate them.
- Include the referenced
scripts/*.tsfiles in the distributed artifact and validate their hashes before invoking the runtime. - Run the publishing process in a restricted environment with access only to the required article files and selected WeChat credentials.
- Remove the automatic
