T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:13
- Finding
- Unpinned Global npm Dependency## Vulnerability Details **File Location**: `SKILL.md`, line 13 **Vulnerability Type**: Supply-chain exposure through an unpinned third-party dependency **Risk Level**: Medium **Vulnerable Code Snippet**: ```markdown - `mail-cli` installed (`npm i -g @clawemail/mail-cli`) with API key configured ``` ### Technical Analysis The documented installation command retrieves the current registry version of `@clawemail/mail-cli` without specifying an exact version or verifying package integrity or provenance. Consequently, the code installed by users can differ from the code originally reviewed. npm packages may execute lifecycle scripts during installation. The global installation flag (`-g`) also places the package in a broadly accessible tool location and exposes the installation process to the privileges of the user running npm. Although the audited project does not contain an actively malicious dependency payload, this installation pattern creates a supply-chain trust boundary that is not cryptographically or reproducibly constrained. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or a future package release. 2. The attacker publishes a malicious version under the same package name. 3. A user follows the documented `npm i -g @clawemail/mail-cli` command. 4. npm retrieves the attacker-controlled current version. 5. Malicious lifecycle code can execute during installation, or malicious behavior can execute when the Skill later invokes `mail-cli`. 6. The compromised tool may access the user environment, configured mail credentials, and email content available under that user account. ### Impact Assessment Exploitation could allow arbitrary code execution with the privileges of the user installing or invoking the package. The potential scope includes theft of mail API credentials, unauthorized mailbox operations, access to notification contents, modification of globally installed tooling, ...[truncated 295 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to an exact, reviewed version, for example: ```bash npm install --global @clawemail/mail-cli@<reviewed-exact-version> ``` 2. Document and verify the expected package integrity digest and publisher provenance before installation. 3. Prefer a project-local dependency with a committed lockfile over global installation where operationally feasible. 4. Use `npm ci` with a reviewed lockfile in a controlled installation workflow. 5. Review dependency lifecycle scripts and disable them with `--ignore-scripts` when they are not required. 6. Run the mail client under a dedicated, least-privileged operating-system account and limit the configured API credential to only the mailbox permissions required for triage. 7. Establish an update process in which new dependency versions are audited before the pinned version is changed.
