T08 · Insecure Dependencies
Warning
- Location
- package.json:19
- Finding
- Unpinned Dependencies and Missing Lockfile Permit Unreviewed Package Code<![CDATA[ ## Vulnerability Details **File Location**: `package.json:19-22`; also documented in `SKILL.md:28-31` and duplicated in `clawhub.json:17-20` **Vulnerability Type**: Supply-chain risk caused by mutable dependency resolution **Risk Level**: Medium ### Complete Code Snippets `package.json:19-22`: ```json "dependencies": { "axios": "^1.6.0", "dayjs": "^1.11.0" } ``` `SKILL.md:28-31`: ```bash cd skills/morning-brief npm install ``` `clawhub.json:17-20`: ```json "dependencies": { "axios": "^1.6.0", "dayjs": "^1.11.0" } ``` ### Technical Analysis The project declares `axios` and `dayjs` with caret version ranges and does not include a package lockfile. Consequently, the documented `npm install` command can resolve dependency versions that differ from those reviewed during this audit. A caret range permits compatible newer releases, including transitive dependencies selected at installation time. If a permitted dependency release or one of its transitive dependencies is compromised, installation can introduce unreviewed code. npm packages may also define lifecycle scripts that execute during installation unless scripts are explicitly disabled. The audited source does not contain evidence that the currently named dependencies are malicious. The issue is the absence of reproducible and integrity-controlled dependency resolution, which creates a conditional supply-chain exploitation path. ### Attack Path 1. An attacker compromises a permitted future release of a declared dependency or one of its transitive dependencies. 2. The attacker adds malicious runtime logic or an npm lifecycle script to that release. 3. A user follows the documented installation procedure and runs `npm install`. 4. npm resolves the compromised version because the caret range allows it and no lockfile constrains resolution to an audited dependency graph. 5. A malicious lifecycle script executes during installation, or malicious package code executes when `main.js` impor ...[truncated 650 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every direct dependency to an exact reviewed version rather than using caret ranges: ```json "dependencies": { "axios": "1.6.0", "dayjs": "1.11.0" } ``` 2. Generate and commit `package-lock.json` so direct and transitive dependency versions and integrity hashes are reproducible. 3. Replace deployment and installation instructions using `npm install` with `npm ci`, which installs the locked dependency graph and fails when the manifest and lockfile disagree. 4. Review the complete locked dependency tree, including transitive packages, before release. 5. Use automated dependency scanning and update dependencies through reviewed pull requests. 6. Where operationally compatible, disable package lifecycle scripts during installation with `npm ci --ignore-scripts`, enabling only explicitly reviewed scripts when necessary. 7. Run installation and the Skill under a dedicated, least-privileged account or isolated container without unnecessary credentials or writable host paths. ]]>
