T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:12
- Finding
- Unpinned npm Dependency Allows Supply-Chain Code Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 12–15 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ### Vulnerable Code ```yaml install: - kind: node package: nansen-cli bins: [nansen] ``` ### Technical Analysis The Skill installs `nansen-cli` without specifying an exact version or package integrity hash. Consequently, installations may resolve to a package release that differs from the one originally reviewed. npm packages can contain executable JavaScript and lifecycle scripts. If the package publisher account, package registry, or release process is compromised, a malicious future version could execute code during installation or when the `nansen` binary is invoked. The Skill also requires `NANSEN_API_KEY`, making that credential a potentially valuable target for compromised dependency code. This finding identifies a supply-chain exposure caused by mutable dependency resolution. The audited file does not itself prove that the current `nansen-cli` release is malicious. ### Attack Path 1. An attacker compromises the `nansen-cli` publisher account or its release pipeline and publishes a malicious update. 2. The Skill installer resolves the unversioned `nansen-cli` declaration to the malicious release. 3. npm installs the package and may execute attacker-controlled lifecycle scripts, or the malicious code runs when the declared `nansen` binary is invoked. 4. The package executes with the privileges of the installing or invoking process. 5. It may read process-accessible data, including `NANSEN_API_KEY`, and perform unauthorized network or filesystem operations within those privileges. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the account running the installer or CLI. The resulting scope may include: - Theft of `NANSEN_API_KEY` and other environment variables available to the process. - Unauthorized use of the victim's Nansen account or API quota. - R ...[truncated 399 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `nansen-cli` to a specific, audited version rather than allowing mutable latest-version resolution. 2. Use a lockfile containing registry-resolved integrity hashes and enforce immutable or frozen-lockfile installation. 3. Verify that the package name, registry source, and publisher are official before installation. 4. Review package contents and lifecycle scripts before approving dependency updates. 5. Disable npm lifecycle scripts during installation where package functionality permits it. 6. Run installation and CLI execution in a least-privileged, isolated environment with restricted filesystem and outbound-network access. 7. Expose `NANSEN_API_KEY` only to the invocation that requires it, avoid making unrelated secrets available, and rotate the key if dependency compromise is suspected. 8. Adopt controlled dependency updates so new versions undergo review before deployment.
