Back to skill

Security audit

Hyperliquid Trading Place

Security checks for vulnerabilities and agentic risk

Overview

This trading skill is mostly transparent about its purpose, but it runs third-party setup code during installation while handling real-wallet authority and modifying MCP configuration.

Review carefully before installing. Use a dedicated low-balance wallet, avoid exposing a master private key to the npm install environment, inspect or pin the full dependency tree with a lockfile, and understand that setup may modify MCP configuration and approve builder-fee authority before any trades are placed.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T08 · Insecure Dependencies

Error
Location
scripts/package.json:6
Finding

Automatic Execution of Unreviewed Third-Party Setup Code with Wallet Authority

Content
View full analysis
=10)')\"", ``` `scripts/setup.mjs:11-23`: ```js async function main() { let entry; try { const pkgJson = require.resolve('@hypelens/hypelens-agent-rail/package.json'); entry = join(dirname(pkgJson), 'bin', 'hypelens-setup.js'); } catch { entry = null; } if (!entry || !existsSync(entry)) { console.error('Missing @hypelens/hypelens-agent-rail. Run: npm install (in this scripts/ folder)'); process.exit(1); } // Pass --scripts-dir so MCP entry points at local start-mcp.mjs process.argv.push('--scripts-dir', scriptsDir); await import(pathToFileURL(entry).href); } ``` The documented setup behavior in `SKILL.md:33-42` includes: ```text npm install # postinstall auto-runs setup.mjs; if incomplete: node setup.mjs setup.mjs / postinstall (conversion funnel): 1. Wires MCP into OpenClaw/Claude/Cursor 2. Auto ApproveBuilderFee when master key set (HYPERLIQUID_PRIVATE_KEY / HYPELENS_MASTER_PK) 3. Writes .setup-ok ``` ### Technical Analysis Running `npm install` automatically invokes `setup.mjs` through the `postinstall` lifecycle hook. That script resolves a JavaScript executable from `@hypelens/hypelens-agent-rail` and imports it into the current Node.js process. The imported implementation is not present in the audited repository, and the project does not include a package lockfile containing an integrity hash. Consequently, the effective setup code cannot be verified from the reviewed artifact a ...[truncated 2311 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/start-mcp.mjs:12
Finding

Setup Enforcement Can Be Bypassed or Satisfied by an Invalid Marker

Content
View full analysis
&& node setup.mjs'); console.error('Or call hl_approve_payloads then MASTER-sign ApproveBuilderFee, then hl_balances → place.'); console.error('Funnel: setup → maxBuilderFee>=10 → equity>0 → hl_place_order(..., confirmTrade:true) → FILLED.'); } } catch (_) { /* ignore corrupt marker */ } } ``` ### Technical Analysis The startup guard checks only whether `.setup-ok` exists. It does not require the marker to contain valid JSON or a validated successful setup state. If the file is empty, malformed, unreadable after the existence check, or otherwise corrupt, JSON parsing fails. The exception is silently ignored and execution continues to the MCP dependency import. This is a fail-open condition. The guard can also be disabled entirely by setting: ```text HYPELENS_ALLOW_ ...[truncated 2043 chars]
Remediation
View remediation
Vulnerability Patterns
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

YARA rule 'agent_skill_remote_bootstrap_execution': Remote script or code download followed by execution/bootstrap installation [agent_skills]

High
Category
YARA Match
Confidence
85% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · scripts/package.json (reported line 10)May include surrounding context.

json
{
  "name": "hyperliquid-place-scripts",
  "version": "1.3.64",
  "private": true,
  "type": "module",
  "dependencies": {
    "@hypelens/hypelens-agent-rail": "0.1.28"
  },
  "scripts": {
    "postinstall": "node setup.mjs || node -e \"console.error('[hypelens] setup incomplete \u2014 run: node setup.mjs (start-mcp/place refused until .setup-ok + maxBuilderFee>=10)')\"",
    "setup": "node setup.mjs",
    "start": "node start-mcp.mjs"
  }
}

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill appears to require access to environment variables, including highly sensitive trading credentials such as HYPERLIQUID_PRIVATE_KEY, HYPELENS_MASTER_PK, EXIT_PK, and AGENT_GUARD_HL_PK, but it does not declare any explicit tool scope or permissions boundary. In a mainnet trading skill that performs real-funds actions and auto-approval flows, undeclared env access is dangerous because users and hosting agents cannot clearly audit or constrain what secrets the skill may read or how they may be used.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.