T08 · Insecure Dependencies
- Location
SKILL.md:13- Finding
Unpinned Third-Party Package Installation and Execution
- Content
View full analysis
Vulnerability Details
File Locations:
SKILL.md:13-16SKILL.md:77-79reference.md:7-14
Vulnerability Type: Unpinned and mutable npm dependency execution
Risk Level: MediumVulnerable Code Snippets
SKILL.md:13-16:yaml - kind: node package: rv-image-optimize bins: - rv-image-optimizeSKILL.md:77-79:bash npx rv-image-optimize "{input}" --output-dir "{outputDir}" --format webp --quality 82 --jsonreference.md:7-14:bash npm install rv-image-optimizebash npx rv-image-optimize ./images --output-dir ./compressed --format webp --quality 82 --jsonTechnical Analysis
The Skill instructs the Agent to install or execute
rv-image-optimizewithout an exact package version, lockfile, or integrity hash. Bothnpm install rv-image-optimizeandnpx rv-image-optimizecan 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
npxis 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-optimizepackage is malicious. The vulnerability is the absence of dependency pinning and integrity controls around remotely sourced executable code.Attack Path
- An attacker compromises the npm package, a maintainer account, or the relevant package publishing workflow.
- The attacker publishes a malicious version under the existing
rv-image-optimizepackage name. - An Agent follows the Skill instructions and runs
npm install rv-image-optimizeor the documented `n ...[truncated 1058 chars]
- Remediation
View remediation
Remediation Suggestions
-
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 -
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 -
Prefer a preinstalled, reviewed binary over automatic
npxdownloading. If the required verified binary is unavailable, stop and request user approval rather than silently fetching the latest package. -
Maintain a lockfile and verify package integrity using npm lockfile integrity metadata or an independently recorded package hash.
-
Review package provenance, maintainer changes, lifecycle scripts, and release contents before updating the pinned version.
-
Execute image-processing dependencies in a restricted environment with minimum filesystem permissions, no unnecessary credentials, and constrained outbound network access.
-
Separate compression and upload privileges where practical so that image conversion code does not automatically inherit access to upload tokens or unrelated sensitive files.
-
