T08 · Insecure Dependencies
- Location
scripts/install_and_run.js:104- Finding
Unpinned Third-Party npm Package Is Installed and Executed Without Integrity Verification
- Content
View full analysis
- Remediation
View remediation
"; ``` 2. Commit a lockfile generated from a reviewed dependency tree and use a deterministic installation process such as `npm ci`. 3. Validate the downloaded package against a known-good integrity digest. Do not treat displayed publisher or maintainer strings as provenance verification. 4. Explicitly pin the trusted npm registry for this installation instead of silently accepting arbitrary registry overrides from the user's npm configuration. 5. Prevent lifecycle scripts during dependency acquisition where feasible: ```bash npm ci --ignore-scripts ``` If lifecycle scripts are required, audit them and their transitive dependencies before enabling them. 6. Separate installation from execution. Show the resolved package version and integrity value, require confirmation when they differ from approved values, and only execute a verified entry point. 7. Run the third-party CLI in a sandbox or restricted subprocess with: - A minimal environment allowlist. - Limited filesystem access. - Restricted network access. - No unnecessary screen-recording, accessibility, or credential-store access. 8. Enable npm audit or an equivalent software-composition analysis step. The current `--no-audit` option suppresses an available dependency risk signal. 9. Document a controlled update procedure requiring review of package contents, lifecycle scripts, dependency changes, and integrity metadata before changing the approved version. ]]>
