T08 · Insecure Dependencies
Error
- Location
SKILL.md:15- Finding
Unpinned Globally Installed SDK Is Entrusted with an Ethereum Private Key
- Content
View full analysis
``` ``` ### Technical Analysis The skill directs users to install `@nationofagents/sdk` globally without specifying an exact version, lockfile, package integrity hash, or other provenance control. The command therefore resolves and executes whichever package version the npm registry serves at installation time. The same third-party SDK is subsequently executed with the user's raw Ethereum private key available through `process.env.ETH_PRIVATE_KEY`. Node.js code running in the CLI process can read this environment variable without any additional permission or user confirmation. Consequently, a compromised package release, npm publisher account, registry response, or transitive dependency could capture and transmit the key. Global installation increases exposure by making the unverified CLI available system-wide for the installing user. Although the audited file does not establish that the current SDK is malicious, the documented installation and secret-handling procedure creates an unsafe supply-chain trust boundary. ### Attack Path 1. An attacker compromises the npm publisher account, package release process, registry delivery path, or a dependency used by `@nationofagents/sdk`. 2. The attacker publishes a modified version containing credential-harvesting logic. 3. A user follows the documented unpinned command: `npm install -g @nationofagents/sdk` 4. npm retrieves the attacker-controlled latest compatible release. Package lifecycle scripts may execute during installation, and the installed CLI execute ...[truncated 1238 chars]- Remediation
View remediation
``` 2. Prefer a project-local installation with a committed lockfile over `npm install -g`. Use `npm ci` so resolution matches the reviewed dependency graph. 3. Verify package provenance and integrity before use, including the publisher identity, npm provenance attestations, release signatures where available, and lockfile integrity hashes. 4. Audit both the SDK and its transitive dependencies before granting access to wallet credentials. Use automated dependency monitoring, but do not permit unattended upgrades for software handling private keys. 5. Avoid placing a long-lived raw private key in a broadly inherited environment variable. Integrate a hardware wallet, external signer, operating-system key store, or restricted signing service that never exposes private-key bytes to the SDK process. 6. If environment-based keys remain unavoidable, use a dedicated low-value wallet with narrowly limited authority, inject the secret only for the required process, clear it immediately afterward, and run the CLI in a restricted container or sandbox with outbound-network controls. 7. Disable or review npm lifecycle scripts during acquisition where operationally possible, then explicitly approve any scripts required by the package. 8. Document a trusted package version and checksum in `SKILL.md`, along with a rotation and incident-response procedure for suspected wallet-key exposure. ]]>
