Back to skill

Security audit

Nansen Defi Positions

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Nansen CLI helper for checking a wallet's DeFi positions, with no hidden execution or unrelated behavior found.

Before installing, confirm you trust the nansen-cli package source and use a NANSEN_API_KEY with the least access needed. Pinning the CLI version would improve reproducibility, but the reviewed skill instructions themselves are coherent and limited.

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:10
Finding
Unpinned Third-Party CLI Dependency## Vulnerability Details **File Location**: `SKILL.md`, lines 10-13 **Vulnerability Type**: Unpinned third-party package installation **Risk Level**: Medium **Vulnerable Code Snippet**: ```yaml install: - kind: node package: nansen-cli bins: [nansen] ``` ### Technical Analysis The Skill instructs the host to install the third-party Node.js package `nansen-cli` without specifying an exact version or package integrity hash. Consequently, the installed code depends on mutable package-registry state and may differ from the version originally reviewed. If the package, its publication account, or one of its transitive dependencies is compromised, malicious lifecycle scripts or runtime code could execute on the host. No evidence establishes that the current package is malicious; the vulnerability is the absence of dependency pinning and integrity controls. ### Attack Path 1. An attacker compromises the `nansen-cli` package, its publisher account, registry resolution, or a transitive dependency. 2. The attacker publishes a malicious package release that remains compatible with the unpinned package reference. 3. The Skill installation process resolves and installs the attacker-controlled release. 4. Malicious code executes through package lifecycle scripts or when the `nansen` binary is invoked. 5. The code accesses resources available to the installation or runtime process, potentially including `NANSEN_API_KEY`, local files, and network connectivity. ### Impact Assessment Exploitation could permit arbitrary code execution with the privileges of the user or service installing or running the Skill. Because the Skill requires `NANSEN_API_KEY`, malicious runtime code could potentially read and exfiltrate that credential. Access to other files, environment variables, and network resources would depend on the privileges and isolation boundaries of the host process. The audited repository itself contains no embedd ...[truncated 108 chars]
Remediation
## Remediation Suggestions - Pin `nansen-cli` to an exact, reviewed version rather than resolving an unrestricted current release. - Verify the package with a trusted registry integrity digest or equivalent checksum. - Use a lockfile with locked transitive dependency versions where the installation framework supports it. - Review the package and its transitive dependencies before approving upgrades. - Disable package lifecycle scripts during installation unless they are explicitly required and reviewed. - Run the CLI in a sandbox or least-privilege environment with access only to the required API key and resources. - Restrict outbound network access to necessary Nansen endpoints where operationally feasible. - Rotate `NANSEN_API_KEY` promptly if dependency compromise is suspected.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.