Back to skill

Security audit

UnifAI

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate UnifAI CLI skill, but it can run unpinned npm code and sign real cryptocurrency transactions using local private keys.

Review this skill carefully before installing. Use a pinned and verified unifai-sdk version, avoid exposing high-value wallet private keys to the CLI, prefer restricted or test wallets, and require manual review of every transaction before using --sign.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

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.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The documentation recommends `npx -p unifai-sdk unifai <command>` without pinning a specific package version. This causes execution of whatever version is current at install time, which weakens supply-chain integrity and can expose users to a compromised or breaking release unexpectedly. In this skill's context, the risk is amplified because the CLI can access API keys and optionally private keys for transaction signing.

Session Persistence

Medium
Category
Rogue Agent
Content
export UNIFAI_AGENT_API_KEY="your-key-here"
```

Or create a config file:

```bash
unifai config init
Confidence
79% confidence
Finding
The skill suggests storing the API key in a persistent config file under `~/.config/unifai-cli/config.yaml`. Persistent credential storage increases the chance of local disclosure through weak file permissions, backups, multi-user systems, or accidental inclusion in logs or dotfile sync tools. In this skill's context, the API key enables access to a broad action surface and may be combined with locally stored signing keys, increasing overall account and operational risk.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill demonstrates signed transaction execution and states that transactions may be automatically signed and submitted, but it does not include an explicit warning that this can move assets or approve spending. In an agent setting, examples strongly influence behavior; a user or agent may treat `--sign` as routine and unintentionally authorize transfers, swaps, or approvals with real funds. Because this tool spans DeFi and wallet actions, the context makes the omission more dangerous than a generic CLI example.

Static analysis

No suspicious patterns detected.