T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:15
- Finding
- Unpinned Third-Party Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:15` and `references/compact-table-template.md:14-16` **Vulnerability Type**: Unpinned npm dependencies and unsafe global package installation **Risk Level**: Medium ### Vulnerable Code `SKILL.md:15`: ```text 1. Ensure `json-render` is available. If missing, run `npm i -g json-render-cli`; if Chromium is missing, run `npx playwright install chromium`. ``` `references/compact-table-template.md:14-16`: ```bash if ! command -v json-render >/dev/null 2>&1; then npm i -g json-render-cli fi ``` ### Technical Analysis The skill instructs the agent to install `json-render-cli` from the npm registry without specifying a reviewed version or verifying package integrity. The installation is global, so it modifies the agent user's shared execution environment rather than an isolated project environment. The Chromium installation instruction also invokes `playwright` through `npx` without pinning a version. Depending on the local environment and npm configuration, `npx` may resolve and execute package code obtained from the registry. npm package installation can execute package lifecycle scripts. Consequently, the effective code executed by this skill is not limited to the files included in the audited project. It can change whenever a new package version is published. A compromised maintainer account, malicious package release, dependency compromise, or unexpected upstream change could therefore result in arbitrary code execution. No evidence indicates that the currently named packages are malicious. The vulnerability is the unpinned and globally installed supply-chain dependency. ### Attack Path 1. A user invokes the table-rendering skill on a system where `json-render` is unavailable, or Chromium needs to be installed. 2. The agent follows the documented setup instructions. 3. `npm i -g json-render-cli` retrieves the latest registry-selected package version and its transitive dependencies. Altern ...[truncated 1227 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin exact reviewed versions of all tools, including `json-render-cli` and Playwright. 2. Maintain a lockfile containing resolved versions and integrity hashes. 3. Install dependencies locally in a dedicated project directory rather than with `npm i -g`. 4. Invoke the pinned local binary through an explicit path or a package script instead of relying on global command resolution. 5. Run installation and rendering inside a restricted container or sandbox with minimal filesystem, environment, and network access. 6. Disable npm lifecycle scripts with `--ignore-scripts` where compatible with the selected packages. 7. If lifecycle scripts are required, review them and their transitive dependencies before allowing execution. 8. Configure npm to use an approved registry and verify package provenance or signatures where supported. 9. Replace implicit `npx playwright` resolution with an explicitly pinned local Playwright dependency. 10. Document a controlled installation procedure and fail safely when the approved dependency version is unavailable rather than installing the latest release automatically. ]]>
