T08 · Insecure Dependencies
- Location
scripts/deploy.sh:82- Finding
Unpinned Vercel CLI Is Downloaded and Executed During Deployment
- Content
View full analysis
/dev/null 2>&1 || { echo "error: npx not found — install Node.js first" >&2 exit 1 } if ! npx --yes vercel whoami >/dev/null 2>&1; then echo "error: not logged into the Vercel CLI." >&2 echo "run: npx vercel login" >&2 echo "then re-run this script." >&2 exit 1 fi VERCEL_ARGS=(deploy --yes --cwd "$DEPLOY_DIR") $PROD && VERCEL_ARGS+=(--prod) URL="$(npx --yes vercel "${VERCEL_ARGS[@]}" 2>&1 | tail -n1)" ``` Related unpinned installation and execution instructions also appear in: - `SKILL.md:26` - `SKILL.md:32` - `SKILL.md:50` - `SKILL.md:214-215` - `SKILL.md:376` Examples include: ```bash npx @presentation-md/install claude-code npx skills add isatimur/presentation-md --skill presentation-generator npx @presentation-md/render deck.json -o deck.html --theme npm i @presentation-md/theme- npx @presentation-md/create-theme ``` ### Technical Analysis The deployment script invokes `npx --yes vercel` without specifying an exact, reviewed package version. If the Vercel CLI is not already installed locally, `npx` can retrieve the currently selected package release from the configured npm registry and execute it immediately. The `--yes` option suppresses the interactive package-installation confirmation. The Skill documentation similarly recommends executing several unversioned npm packages. The effective code run by these commands can therefore change after this Skill package has been reviewed. A compromised upstream account, malicious future release, registry compromise, or manipulated npm registry configuration could cause arbitrary package lifecycle or CLI code to execute. Although `scripts/package-lock.json` pins Playwright artifacts with integrity hashes, that lockfile does not protect the separate `npx ve ...[truncated 1421 chars]- Remediation
View remediation
whoami npx --yes vercel@ "${VERCEL_ARGS[@]}" ``` 2. Prefer declaring the CLI in a project-local `package.json`, committing the corresponding lockfile, and installing it with: ```bash npm ci --ignore-scripts ``` Only omit `--ignore-scripts` if a reviewed dependency genuinely requires lifecycle scripts. 3. Execute the locked local binary instead of dynamically resolving a package: ```bash "$SCRIPT_DIR/node_modules/.bin/vercel" ... ``` 4. Pin all packages shown in `SKILL.md` to reviewed exact versions rather than tags or unconstrained latest releases. 5. Validate registry configuration and use trusted registries only. Where available, verify package provenance and signatures. 6. Run installation and rendering commands in a sandbox with: - Minimal filesystem mounts. - No unrelated credentials. - Restricted environment variables. - Egress controls. - A non-privileged operating-system account. 7. Remove `--yes` where automatic package acquisition is unnecessary, or explicitly verify that the expected package and version are already installed before execution. ]]>
