T08 · Insecure Dependencies
- Location
scripts/main.ts:19- Finding
Unpinned Bun Runtime Downloaded and Executed Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:35andscripts/main.ts:19
Vulnerability Type: Unpinned runtime dependency retrieval and execution
Risk Level: MediumVulnerable Code
SKILL.md:35:markdown Scripts in `scripts/` subdirectory. `{baseDir}` = this SKILL.md's directory path. Resolve `${BUN_X}` runtime: if `bun` installed → `bun`; if `npx` available → `npx -y bun`; else suggest installing bun. Replace `{baseDir}` and `${BUN_X}` with actual values.scripts/main.ts:4-20:typescript function formatScriptCommand(fallback: string): string { const raw = process.argv[1] const displayPath = raw ? (() => { const relative = path.relative(process.cwd(), raw) return relative && !relative.startsWith("..") ? relative : raw })() : fallback const quotedPath = displayPath.includes(" ") ? `"${displayPath.replace(/"/g, '\\"')}"` : displayPath return `npx -y bun ${quotedPath}` }Technical Analysis
The Skill directs the Agent to use
npx -y bunwhenever a locally installed Bun executable is unavailable. This command resolves and downloads the package currently identified asbunthrough the configured npm registry and immediately executes it.No exact Bun package version or package integrity value is specified. The
-yoption also suppresses the normal installation confirmation. Consequently, the code that executes at runtime is not fully represented by the audited repository and can change independently after this Skill has been reviewed.The lockfile pins the local
markdown-itdependency and its transitive packages, but it does not constrain or authenticate the Bun runtime downloaded by this separate npx invocation. This creates a supply-chain trust boundary at execution time.Attack Path
- A system invokes the Skill on a host where
bunis not already installed butnpxis available. - Following
SKILL.md, the Agent selects the fallback commandnpx -y bun...[truncated 1453 chars]
- A system invokes the Skill on a host where
- Remediation
View remediation
Remediation Suggestions
- Remove the automatic
npx -y bunfallback and require a trusted, preinstalled Bun executable. - If automatic retrieval is necessary, pin an explicitly audited Bun package version rather than resolving the latest available version.
- Verify the downloaded runtime using an approved checksum, signature, or organization-controlled package provenance policy before execution.
- Do not suppress installation confirmation with
-y; obtain explicit user approval before downloading and executing a missing runtime. - Prefer a trusted internal package registry or an organization-managed runtime installation mechanism.
- Document the expected Bun version and validate it before running the chunking script.
- Consider eliminating the runtime download requirement by distributing a compiled, reproducible executable or rewriting the small chunking utility for a runtime already guaranteed by the host environment.
- Keep dependency installation separate from Skill execution so dependency review and approval occur before the Skill processes user files.
- Remove the automatic
