T08 · Insecure Dependencies
- Location
SKILL.md:119- Finding
Unpinned Package Retrieval and Execution During WeChat Publication
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 119–122 and line 133
Vulnerability Type: Unpinned third-party package execution
Risk Level: MediumComplete Code Snippet
markdown Unique approved command: ```text cd "<article directory>" && npx -y bun "C:\Users\guoyu\.workbuddy\skills\baoyu-post-to-wechat\scripts\wechat-api.ts" <article.md> --theme modern --color "#005BAC" --no-cite --cover <cover path> --account wangyinzhongniantext The documented fallback also invokes the same unpinned package: ```markdown | Error `Cannot find module '@baoyu-skills/wechat-api'` | The obsolete script was used; switch to the approved path and retry | If the approved path also reports a missing module, run `npx -y bun --version` to verify Bun availability and provide the diagnostic result for manual review |Technical Analysis
The command uses
npx -y bunwithout an exact package version, lockfile, or integrity constraint. If Bun is not already available through an accepted local resolution,npxcan retrieve the currently resolvedbunpackage from the configured npm registry and execute it automatically. The-yoption suppresses the normal installation confirmation.Consequently, the effective executable is not fixed to the artifact that was audited. Its behavior can change after review due to package updates, registry compromise, account compromise, registry configuration changes, or dependency-resolution manipulation. The repository does not include the resolved package or the referenced external
wechat-api.ts, so neither component can be verified from the reviewed project.This is especially sensitive because the command runs during publication, when the process may have access to unpublished articles, cover files, environment variables, local publishing configuration, and WeChat credentials used by the external publishing script.
Attack Path
- An attacker compromises the remotely resolv ...[truncated 1553 chars]
- Remediation
View remediation
Remediation Suggestions
- Install Bun in advance from an official, verified distribution and invoke the installed executable directly rather than using
npx. - If npm-based installation is unavoidable, pin an exact audited package version, for example
bun@<exact-version>, rather than resolving the latest available version. - Commit and enforce a lockfile containing integrity metadata. Use deterministic installation such as
npm ciin a controlled setup phase. - Disable implicit package downloads during publication. The publication step should fail closed if the approved local Bun executable is unavailable.
- Verify package signatures or integrity hashes against a trusted value before execution.
- Vendor or otherwise version-control the referenced publishing script and audit its full dependency tree.
- Execute the publisher in a least-privilege environment with access only to the required article, cover image, and narrowly scoped publishing credentials.
- Restrict environment-variable exposure and outbound network access to the endpoints required for WeChat publication.
- Replace
npx -y bun --versionwith a direct check of the approved local binary, such as an absolute-path invocation.
- Install Bun in advance from an official, verified distribution and invoke the installed executable directly rather than using
