T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:43
- Finding
- Unpinned npm Package Is Automatically Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:23-27`, `SKILL.md:43-48`, and `SKILL.md:66-71` **Vulnerability Type**: Unpinned runtime dependency execution **Risk Level**: Medium ### Vulnerable Code ```yaml install: - kind: node package: chartsplat-cli bins: [chartsplat] label: "Install Chart Splat CLI via npm" ``` ```bash npx -y chartsplat-cli bar \ --labels "Q1,Q2,Q3,Q4" \ --data "50,75,60,90" \ --title "Quarterly Revenue" \ --color "#8b5cf6" \ -o chart.png ``` Additional documented invocations execute the same unpinned package: ```bash npx -y chartsplat-cli line -l "Mon,Tue,Wed,Thu,Fri" -d "100,200,150,300,250" -o line.png npx -y chartsplat-cli bar -l "A,B,C" -d "10,20,30" -o bar.png npx -y chartsplat-cli pie -l "Red,Blue,Green" -d "30,50,20" -o pie.png npx -y chartsplat-cli doughnut -l "Yes,No,Maybe" -d "60,25,15" -o doughnut.png npx -y chartsplat-cli radar -l "Speed,Power,Range,Durability,Precision" -d "80,90,70,85,95" -o radar.png npx -y chartsplat-cli polararea -l "N,E,S,W" -d "40,30,50,20" -o polar.png npx -y chartsplat-cli candlestick --config ohlc.json -o chart.png ``` ### Technical Analysis The Skill recommends executing `chartsplat-cli` through `npx -y` without an exact package version or integrity-protected lockfile. The `-y` option suppresses confirmation, allowing npm to download and execute the package automatically. Because package resolution is not pinned, the effective executable can change after the Skill has been reviewed. A future release, compromised maintainer account, compromised registry artifact, or dependency-chain compromise could introduce arbitrary lifecycle or runtime code. That code would execute under the permissions of the user or Agent running the Skill. The chart-rendering task does not inherently require downloading a mutable executable on every invocation. This behavior therefore grants the dependency supply chain more authority than is necessary. ### Attack Path 1. An at ...[truncated 1326 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `chartsplat-cli` to a reviewed exact version, for example: ```bash npx --no-install chartsplat-cli ``` after installing a fixed version during a controlled setup step. 2. Declare the exact version rather than a floating package name: ```yaml package: chartsplat-cli@<reviewed-exact-version> ``` 3. Include a lockfile containing registry URLs and integrity hashes, and enforce reproducible installation with `npm ci`. 4. Avoid `npx -y` for production or Agent runtime execution. Install dependencies in a controlled build or provisioning phase and execute only the locally verified binary. 5. Use a trusted registry and verify package provenance, signatures, maintainers, and published integrity metadata. 6. Audit and pin transitive dependencies. Add automated dependency monitoring, but require review before accepting upgrades. 7. Run the CLI in a restricted environment with: - Minimal filesystem access. - Only the required API credential. - Network egress limited to the documented Chart Splat endpoint. - No access to unrelated workspace secrets. ]]>
