T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:13
- Finding
- Unpinned Third-Party Package Installation and Execution## Vulnerability Details **File Locations**: - `SKILL.md:13-16` - `SKILL.md:77-79` - `reference.md:7-14` **Vulnerability Type**: Unpinned and mutable npm dependency execution **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:13-16`: ```yaml - kind: node package: rv-image-optimize bins: - rv-image-optimize ``` `SKILL.md:77-79`: ```bash npx rv-image-optimize "{input}" --output-dir "{outputDir}" --format webp --quality 82 --json ``` `reference.md:7-14`: ```bash npm install rv-image-optimize ``` ```bash npx rv-image-optimize ./images --output-dir ./compressed --format webp --quality 82 --json ``` ### Technical Analysis The Skill instructs the Agent to install or execute `rv-image-optimize` without an exact package version, lockfile, or integrity hash. Both `npm install rv-image-optimize` and `npx rv-image-optimize` can resolve the package version from the npm registry at execution time. Consequently, the executable code used by the Skill can change after this repository has been audited. If the package, maintainer account, publishing credentials, or registry resolution path is compromised, a later package release could introduce malicious installation lifecycle scripts or malicious CLI behavior. The fallback to `npx` is particularly sensitive because it may download and immediately execute a package that is not already installed locally. This finding does not establish that the current `rv-image-optimize` package is malicious. The vulnerability is the absence of dependency pinning and integrity controls around remotely sourced executable code. ### Attack Path 1. An attacker compromises the npm package, a maintainer account, or the relevant package publishing workflow. 2. The attacker publishes a malicious version under the existing `rv-image-optimize` package name. 3. An Agent follows the Skill instructions and runs `npm install rv-image-optimize` or the documented `n ...[truncated 1058 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to an audited exact version rather than resolving the latest release: ```yaml - kind: node package: rv-image-optimize@3.0.30 bins: - rv-image-optimize ``` 2. Update installation examples to use the same exact version: ```bash npm install --save-exact rv-image-optimize@3.0.30 npx --package=rv-image-optimize@3.0.30 rv-image-optimize ./images --output-dir ./compressed --format webp --quality 82 --json ``` 3. Prefer a preinstalled, reviewed binary over automatic `npx` downloading. If the required verified binary is unavailable, stop and request user approval rather than silently fetching the latest package. 4. Maintain a lockfile and verify package integrity using npm lockfile integrity metadata or an independently recorded package hash. 5. Review package provenance, maintainer changes, lifecycle scripts, and release contents before updating the pinned version. 6. Execute image-processing dependencies in a restricted environment with minimum filesystem permissions, no unnecessary credentials, and constrained outbound network access. 7. Separate compression and upload privileges where practical so that image conversion code does not automatically inherit access to upload tokens or unrelated sensitive files.
