T08 · Insecure Dependencies
Warning
- Location
- assets/vitepress/package.json:9
- Finding
- Unpinned npm Dependencies Permit Unreviewed Supply-Chain Code Execution<![CDATA[ ## Vulnerability Details **File Location**: `assets/vitepress/package.json:9-13` **Related Locations**: `SKILL.md:78-93`, `references/deploy-cloudflare.md:13-16` **Vulnerability Type**: Unpinned third-party dependencies and mutable package execution **Risk Level**: Medium ### Vulnerable Code `assets/vitepress/package.json:9-13` ```json "devDependencies": { "mermaid": "*", "vitepress": "*", "vitepress-plugin-mermaid": "*" } ``` `SKILL.md:78-93` ```bash npm --prefix codewiki install ``` ```bash npx -p vitepress -p vitepress-plugin-mermaid -p mermaid vitepress dev codewiki ``` `references/deploy-cloudflare.md:13-16` ```bash npm install -g wrangler ``` ### Technical Analysis The packaged VitePress dependencies use the wildcard version constraint `*`, and the documented `npx` and global Wrangler installation commands do not specify versions. No lockfile is included to constrain transitive dependency resolution. As a result, separate executions of the documented workflow can retrieve different package releases that were not present during this audit. Both npm installation and `npx` execution may run package lifecycle scripts or package-provided executables with the permissions of the invoking user. The project does not itself contain a malicious dependency payload, and no evidence was found that the current packages are intentionally malicious. The vulnerability is the absence of dependency integrity and version controls, which creates an execution path for a future compromised, malicious, or unexpectedly changed upstream release. Installing Wrangler globally additionally modifies the user-wide Node.js environment, increasing the persistence and scope of any compromised package compared with a project-local installation. ### Attack Path 1. An attacker compromises a maintainer account, package release process, or transitive dependency associated with `vitepress`, `vitepress-plugin-mermaid`, `mermaid`, or `wrangler`. 2. The attacker pub ...[truncated 1538 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace wildcard constraints with exact, reviewed versions: ```json { "devDependencies": { "mermaid": "<reviewed-exact-version>", "vitepress": "<reviewed-exact-version>", "vitepress-plugin-mermaid": "<reviewed-exact-version>", "wrangler": "<reviewed-exact-version>" } } ``` 2. Generate, review, and commit `package-lock.json` so direct and transitive dependency versions and integrity hashes are reproducible. 3. Replace: ```bash npm --prefix codewiki install ``` with: ```bash npm --prefix codewiki ci ``` 4. Avoid unversioned ephemeral execution. Pin every `npx` package explicitly, or preferably execute binaries from the lockfile-controlled local installation: ```bash npm --prefix codewiki exec -- vitepress dev . ``` 5. Replace the global Wrangler installation with a project-local, pinned development dependency. Execute it through the local package context rather than modifying the user-wide environment. 6. Where compatible with the selected packages, consider disabling lifecycle scripts during installation: ```bash npm --prefix codewiki ci --ignore-scripts ``` Confirm first that no required dependency legitimately relies on an installation script. 7. Use a controlled dependency-update process that includes automated vulnerability scanning, integrity review, changelog inspection, and testing before lockfile updates are accepted. 8. Run documentation builds in a restricted environment with minimal filesystem access, no unnecessary secrets, and limited outbound network connectivity. ]]>
