T08 · Insecure Dependencies
- Location
scripts/init.sh:98- Finding
Unpinned Third-Party Packages Are Installed and Executed
- Content
View full analysis
Vulnerability Details
File Location:
scripts/init.sh:98-115, 142-145;SKILL.md:49-53
Vulnerability Type: Unpinned npm dependency installation and execution
Risk Level: MediumVulnerable Code
scripts/init.sh:98-115:bash if [ ! -f "$WORKSPACE/package.json" ]; then cat > "$WORKSPACE/package.json" <<'PKGJSON' { "name": "token-image-workspace", "private": true, "type": "module", "scripts": { "render": "token-image render", "render:2x": "token-image render --scale 2", "editor": "token-image editor" }, "dependencies": { "@zane-chen/token-image": "^0.1.0", "react": "^18.3.0" }, "devDependencies": { "tsx": "^4.0.0", "typescript": "^5.0.0", "@types/node": "^20.0.0", "@types/react": "^18.0.0" } }scripts/init.sh:142-145:bash # 6. Install dependencies echo " Installing dependencies..." (cd "$WORKSPACE" && npm install --quiet) echo " ✓ Dependencies installed"SKILL.md:49-53:bash Ensure Playwright browsers are installed: ```bash npx playwright install chromiumtext ### Technical Analysis The generated workspace uses caret-based semantic version ranges rather than exact package versions and does not include a reviewed lockfile. Running `npm install` therefore allows npm to resolve newer compatible package releases after the Skill has been audited. npm installation may execute package lifecycle scripts with the permissions of the user running the Skill. The installed `@zane-chen/token-image` package is subsequently invoked by the `render` and `editor` scripts, giving resolved package code an additional execution path. The pre-flight command also invokes `npx playwright` without an explicit version. If Playwright is not already available locally, `npx` may retrieve and execute a registry package whose contents were not included in this audit. These b ...[truncated 1908 chars]- Remediation
View remediation
Remediation Suggestions
- Replace all caret ranges with reviewed exact versions, for example
"@zane-chen/token-image": "0.1.0". - Generate, review, and distribute a
package-lock.jsoncontaining resolved versions and integrity hashes. - Use
npm ciwith the committed lockfile instead ofnpm installto enforce deterministic resolution. - Add Playwright as an exact, locally installed dependency and invoke its local binary. Avoid an unversioned
npx playwrightcommand. - If
npxremains necessary, specify an exact reviewed version and disable interactive package substitution, such asnpx --no-install playwright ...after local installation. - Evaluate whether dependency lifecycle scripts are required. Where compatible, install with
--ignore-scriptsand explicitly run only reviewed setup operations. - Configure an approved npm registry and use provenance, integrity, and package-signing controls where available.
- Run installation and rendering in a sandbox with minimal filesystem access, no sensitive environment variables, and restricted outbound network access.
- Avoid
--quietin security-sensitive installation workflows so warnings and lifecycle activity remain visible in logs.
- Replace all caret ranges with reviewed exact versions, for example
