T08 · Insecure Dependencies
- Location
templates/package.json:9- Finding
Unpinned npm Dependencies Permit Unreviewed Supply-Chain Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
templates/package.json:9-15; installation is triggered byscripts/init-dashboard.sh:41-42
Vulnerability Type: T08: Insecure Dependencies
Risk Level: MediumVulnerable Code
templates/package.json:9-15:json "dependencies": { "@kjgl77/datav-vue3": "^1.7.4", "vue": "^3.4.0" }, "devDependencies": { "@slidev/cli": "latest", "@slidev/theme-default": "latest" }scripts/init-dashboard.sh:41-42:sh echo "▸ Installing dependencies (npm install) …" ( cd "$TARGET" && npm install )Technical Analysis
The scaffold automatically runs
npm installwithout providing a lockfile. Two dependencies use the unrestrictedlatesttag, while the remaining dependencies use caret ranges that permit newer compatible releases.As a result, installations are not reproducible and may retrieve package or transitive-dependency versions that were never reviewed with this Skill. npm installation can also execute dependency lifecycle scripts, including
preinstall,install, andpostinstall, under the privileges of the user running the scaffold.This is a supply-chain risk rather than evidence that the currently named packages are malicious. Exploitation would require a future package release, registry account, package source, or transitive dependency to become compromised.
Attack Path
- An attacker compromises a permitted direct or transitive npm dependency, or publishes a malicious version selected by
latestor an allowed semantic-version range. - A user follows the documented workflow and invokes
scripts/init-dashboard.sh. - The script creates or updates the target project and automatically runs
npm install. - npm resolves the compromised, previously unaudited version because no lockfile constrains dependency resolution.
- Any malicious lifecycle script executes with the invoking user's operating-system priv ...[truncated 793 chars]
- An attacker compromises a permitted direct or transitive npm dependency, or publishes a malicious version selected by
- Remediation
View remediation
Remediation Suggestions
- Replace
latestand caret ranges with reviewed, exact dependency versions. - Generate and include a
package-lock.jsonproduced from those exact versions. - Replace
npm installwithnpm ciso installation fails if the manifest and lockfile differ. - Review direct and transitive dependencies before updating the lockfile.
- Use automated dependency scanning and integrity verification in CI.
- Where dependency lifecycle scripts are unnecessary, install with
npm ci --ignore-scripts; explicitly run only reviewed setup steps afterward. - Avoid running the scaffold with root, administrator, or other elevated privileges.
- Replace
