T08 · Insecure Dependencies
Error
- Location
- SKILL.md:30
- Finding
- Unpinned Dependency Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 30-34 **Vulnerability Type**: Supply-chain exposure through unrestricted package installation and execution **Risk Level**: High ### Vulnerable Code ```bash cd <dashboard-dir> && pnpm install --frozen-lockfile 2>/dev/null || pnpm install ``` ```bash cd <dashboard-dir> && GRAPH_DIR=<project-dir> npx vite --open ``` ### Technical Analysis The skill first attempts installation with a frozen lockfile but automatically falls back to an unrestricted `pnpm install` if the initial command fails. This fallback can resolve package versions that are not fixed by the reviewed lockfile, weakening dependency integrity guarantees. The subsequent use of `npx vite --open` also does not explicitly require a pinned, locally installed Vite binary. If the executable is unavailable locally, `npx` may offer to retrieve and execute a package from the configured registry. Package installation can additionally execute dependency lifecycle scripts with the privileges of the user running the skill. This creates a supply-chain code-execution boundary in which package registry contents, dependency metadata, lockfile state, and package lifecycle scripts can influence locally executed code. ### Attack Path 1. The dashboard has a missing, invalid, outdated, or incompatible lockfile, or the frozen installation otherwise fails. 2. The `|| pnpm install` fallback performs dependency resolution without requiring the reviewed lockfile to remain unchanged. 3. An attacker-controlled or compromised dependency version is selected from the configured package registry. 4. Malicious code runs through an installation lifecycle script or when the dashboard package is loaded. 5. Alternatively, if no local Vite executable is available, `npx vite` retrieves or executes a registry-supplied package. 6. The package executes with the privileges and environment access of the user who invoked the skill. ### Impact Assessment Successful ...[truncated 503 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require a reviewed and committed lockfile, and terminate if frozen installation fails: ```bash cd -- "$dashboard_dir" || exit 1 pnpm install --frozen-lockfile || exit 1 ``` 2. Do not silently fall back to an installation that can update dependency resolution. 3. Declare Vite as a pinned local dependency and invoke it without registry fallback: ```bash pnpm exec vite --open ``` 4. Validate that the resolved executable belongs to the reviewed dashboard installation before running it. 5. Review dependency lifecycle scripts and use `--ignore-scripts` where installation scripts are unnecessary. 6. Pin the package manager version and verify the integrity and provenance of the lockfile and downloaded packages. 7. Avoid suppressing installation errors with `2>/dev/null`; report failures so users can make an informed decision. ]]>
