T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:39
- Finding
- Unpinned Third-Party CLI Executes in a Sensitive Key-Bearing Context## Vulnerability Details **File Location**: `SKILL.md`, lines 39-45 **Vulnerability Type**: Unpinned executable dependency **Risk Level**: Medium ### Vulnerable Code ```markdown Install globally so the binary is available locally: ```bash npm install -g unifai-sdk ``` Or use via npx (no install needed) ```bash -npx -p unifai-sdk unifai <command> ``` ``` The package is also declared without an exact version in the metadata at `SKILL.md:5`: ```yaml "install":[{"id":"node","kind":"node","package":"unifai-sdk","bins":["unifai"],"label":"Install unifai-sdk (node)"}] ``` ### Technical Analysis The installation instructions and package metadata identify `unifai-sdk` without pinning an audited version or integrity digest. Both global npm installation and npx package execution can therefore resolve to a package release that differs from the version reviewed when this Skill was published. This is particularly sensitive because the installed executable requires `UNIFAI_AGENT_API_KEY` and may run with `SOLANA_PRIVATE_KEY` or `EVM_PRIVATE_KEY` available. It is also authorized to sign and submit financial transactions. A compromised package release, registry account, or transitive dependency could consequently execute arbitrary code with the invoking user's privileges and access credentials present in the process environment. The documentation references source code on GitHub, but it does not establish that the registry artifact installed at runtime corresponds to reviewed source. The leading `-` in the npx example also appears to be a syntax error, though that typo is not itself the security vulnerability. ### Attack Path 1. An attacker compromises the npm package publisher, package release process, or a dependency incorporated into a later `unifai-sdk` release. 2. The attacker publishes a malicious or backdoored version under the existing package name. 3. A user or agent follows `npm install -g unifai-sdk` or invokes the unversioned package through npx. 4. npm ...[truncated 1244 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to an exact, independently reviewed release in both metadata and commands, for example `unifai-sdk@1.0.3`, provided that version has been verified. 2. Use a lockfile and registry integrity hashes where the installation framework supports them. 3. Verify npm provenance, publisher identity, signatures, and correspondence between the registry artifact and referenced source repository. 4. Avoid runtime npx downloads in workflows where API keys or wallet private keys are available. 5. Install dependencies in a controlled build phase and scan the resolved package and complete transitive dependency tree before use. 6. Run the CLI with least privilege and expose sensitive environment variables only to the specific signing operation that requires them. 7. Isolate transaction signing from service discovery and remote invocation where feasible. 8. Before signing, decode and display the complete transaction—including network, recipient, assets, amounts, approvals, and fees—and require explicit user confirmation. 9. Use restricted or low-value wallets for automation, and prefer hardware-backed or policy-controlled signing over raw private keys in environment variables. 10. Correct the malformed `-npx` example to prevent ambiguous or failed execution.
