T08 · Insecure Dependencies
Warning
- Location
- scripts/package.json:6
- Finding
- Non-Reproducible npm Installation Uses an Unlocked Dependency Range<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md`, lines 37-40 - `scripts/package.json`, lines 6-8 **Vulnerability Type**: Unlocked and mutable third-party dependency installation **Risk Level**: Medium ### Vulnerable Code `SKILL.md`, lines 37-40: ```bash ### Step 1 — Install dependencies (first use only) ```bash cd scripts && npm install && cd .. ``` ``` `scripts/package.json`, lines 6-8: ```json "dependencies": { "@notionhq/client": "^2.2.15" } ``` ### Technical Analysis The documented installation procedure runs `npm install`, but the project does not include a package lockfile. In addition, the caret version constraint (`^2.2.15`) permits npm to install later compatible releases of `@notionhq/client`. Transitive dependencies are likewise not fixed by the audited artifact. As a result, installation is not reproducible: users can receive dependency code that differs from the code available when the Skill was reviewed. npm installation can also execute package lifecycle scripts unless they are explicitly disabled. There is no evidence in the audited project that `@notionhq/client` is currently malicious, typosquatted, or obtained from an unsafe registry. The vulnerability is the absence of dependency integrity controls, which increases exposure to a future compromised release, compromised transitive dependency, registry attack, or malicious lifecycle script. ### Attack Path 1. An attacker compromises a future package release or a transitive dependency allowed by the unresolved dependency graph. 2. A user follows the Skill documentation and runs `npm install` in the `scripts` directory. 3. npm resolves the mutable dependency graph and downloads the compromised package version. 4. Malicious code executes during an npm lifecycle hook or when `notion-push.js` imports and uses the package. 5. The dependency executes with the privileges of the user running the Skill and may access the process environment, filesystem resources available ...[truncated 679 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the caret dependency range with an exact, reviewed version: ```json "dependencies": { "@notionhq/client": "2.2.15" } ``` 2. Generate and commit a reviewed `package-lock.json` so direct and transitive dependency versions and integrity hashes are fixed. 3. Change the documented installation command from `npm install` to the reproducible installation command: ```bash cd scripts && npm ci && cd .. ``` 4. If dependency lifecycle scripts are not required, disable them during installation: ```bash cd scripts && npm ci --ignore-scripts && cd .. ``` 5. Review the resolved dependency tree and lifecycle scripts before publishing updates. Use dependency vulnerability scanning and automated update review rather than accepting unreviewed versions automatically. 6. Run installation and the tracker under a minimally privileged account. Restrict the Notion integration to only the database required by this Skill, limiting the impact of possible credential compromise. ]]>
