Back to skill

Security audit

Aicoin Hyperliquid

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate AiCoin analytics skill, but it needs review because it broadly handles local API secrets and can call much more of the AiCoin API than its Hyperliquid framing suggests.

Install only if you are comfortable with a networked AiCoin API tool that may read existing .env files, save an AiCoin API secret in plaintext, and call non-Hyperliquid AiCoin endpoints. Use a dedicated low-privilege AiCoin key, keep unrelated secrets out of the working and OpenClaw .env files, and verify AICOIN_BASE_URL points only to the official AiCoin service. I found no evidence of wallet private-key access, trading authority, destructive actions, or hidden persistence.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
lib/client.mjs:39
Finding

Authentication Requests Can Be Redirected to an Arbitrary Network Destination

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
lib/client.mjs:130
Finding

API Secrets Are Accepted in Process Arguments and Written to Plaintext Files Without Explicit Permission Hardening

Content
View full analysis
= 2) { id = rest[0]; secret = rest[1]; } if (!id || !secret) { return out({ ok: false, error: { code: 'bad_args', message: "用法: set-key 或 set-key ''(JSON 字段名兼容 api_key/access_key、access_key_id/access_secret 等;AiCoin 后台 api_key 是 ID、access_key 是 SECRET)" } }); } const r = await saveKey(id, secret); return out(r.ok ? { ok: true, message: `key 已保存到 ${r.file}` } : { ok: false, error: { code: 'invalid_key', message: r.error } }); } ``` The credential is then stored in a plaintext `.env` file: ```js // Persist a new key pair to the workspace .env (validates before writing). export async function saveKey(keyId, secret) { const headers = authHeaders(keyId, secret); const res = await fetch(`${BASE}/api/v3/coins/tickers?coin_key=bitcoin`, { headers, signal: AbortSignal.timeout(15000) }); if (res.status === 401 || res.status === 403) return { ok: false, error: `key 验证失败 (HTTP ${res.status})` }; if (!res.ok) return { ok: false, error ...[truncated 2571 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
lib/defaults.json:1
Finding

Reusable Shared API Credential Is Embedded in the Distributed Source

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (40)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 18)May include surrounding context.

md
node scripts/aicoin.mjs <接口> '<JSON 参数>'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 24)May include surrounding context.

md
node scripts/aicoin.mjs <接口> '<JSON 参数>'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 25)May include surrounding context.

md
node scripts/aicoin.mjs <接口> '<JSON 参数>'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 28)May include surrounding context.

md
node scripts/aicoin.mjs <接口> '<JSON 参数>'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 29)May include surrounding context.

md
node scripts/aicoin.mjs <接口> '<JSON 参数>'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

md
node scripts/aicoin.mjs <接口> '<JSON 参数>'

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 82)May include surrounding context.

md
node scripts/aicoin.mjs <接口> '<JSON 参数>'

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

This code explicitly implements .env discovery and secret ingestion from the working directory and user-home OpenClaw paths, giving the skill access to locally stored credentials beyond its immediate runtime inputs. In an agent ecosystem, that materially increases the blast radius because the skill can read secrets that belong to other tools or sessions.

Content

Scanner excerpt · lib/client.mjs (reported line 11)May include surrounding context.

js
const __dirname = dirname(fileURLToPath(import.meta.url));

// ── .env auto-load (OpenClaw exec may not inject env into child processes) ──
const ENV_FILES = [
  resolve(process.cwd(), '.env'),
  resolve(process.env.HOME || '', '.openclaw', 'workspace', '.env'),

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

Including the workspace .env path in the search list causes the skill to ingest credentials from a shared execution area, not just from its own dedicated configuration. That increases the chance of cross-skill secret exposure and unintended credential reuse in a multi-tool environment.

Content

Scanner excerpt · lib/client.mjs (reported line 13)May include surrounding context.

js
// ── .env auto-load (OpenClaw exec may not inject env into child processes) ──
const ENV_FILES = [
  resolve(process.cwd(), '.env'),
  resolve(process.env.HOME || '', '.openclaw', 'workspace', '.env'),
  resolve(process.env.HOME || '', '.openclaw', '.env'),
];

Credential Access

High
Category
Privilege Escalation
Confidence
86% confidence
Finding

Searching the user's home OpenClaw .env further broadens credential access beyond the local project boundary. This makes the behavior more dangerous in context because an analytics skill can pull in account-level secrets from a global agent environment that the user did not intend this skill to read.

Content

Scanner excerpt · lib/client.mjs (reported line 14)May include surrounding context.

js
// ── .env auto-load (OpenClaw exec may not inject env into child processes) ──
const ENV_FILES = [
  resolve(process.cwd(), '.env'),
  resolve(process.env.HOME || '', '.openclaw', 'workspace', '.env'),
  resolve(process.env.HOME || '', '.openclaw', '.env'),
];
for (const file of ENV_FILES) {

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

The loop over multiple candidate .env files operationalizes broad secret harvesting rather than a single explicit configuration source. In the context of a read-only analytics skill, this is an unnecessary elevation in credential access capability and increases exposure if the process, logs, or dependent modules are compromised.

Content

Scanner excerpt · lib/client.mjs (reported line 15)May include surrounding context.

js
const ENV_FILES = [
  resolve(process.cwd(), '.env'),
  resolve(process.env.HOME || '', '.openclaw', 'workspace', '.env'),
  resolve(process.env.HOME || '', '.openclaw', '.env'),
];
for (const file of ENV_FILES) {
  if (!existsSync(file)) continue;

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

Assigning discovered .env values into process.env makes all subsequently loaded code in the same process able to access those secrets, not just this client module. That propagation can unintentionally widen internal exposure and facilitate leakage through unrelated libraries or debugging output.

Content

Scanner excerpt · lib/client.mjs (reported line 30)May include surrounding context.

js
if ((v.startsWith('"') && v.endsWith('"')) || (v.startsWith("'") && v.endsWith("'"))) v = v.slice(1, -1);
      if (!process.env[k]) process.env[k] = v;
    }
  } catch { /* ignore unreadable .env */ }
}

const defaults = JSON.parse(readFileSync(resolve(__dirname, 'defaults.json'), 'utf-8'));

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The saveKey function not only accesses credentials but persists them to a discovered .env file after a network validation step. This creates long-lived secrets on disk in potentially shared or poorly protected locations, making theft, accidental commit, and cross-tool exposure substantially more likely.

Content

Scanner excerpt · lib/client.mjs (reported line 134)May include surrounding context.

js
return hit ? { method: hit.method, spec: hit } : null;
}

// Persist a new key pair to the workspace .env (validates before writing).
export async function saveKey(keyId, secret) {
  const headers = authHeaders(keyId, secret);
  const res = await fetch(`${BASE}/api/v3/coins/tickers?coin_key=bitcoin`, { headers, signal: AbortSignal.timeout(15000) });

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The endpoint catalog grants access to a very broad authenticated API surface far beyond the declared Hyperliquid whale/perps analytics scope, including content, airdrops, equities, macro, signals, and treasury data. In an agent-skill setting, this violates least privilege and creates scope-confusion risk: prompts intended for Hyperliquid analytics could be steered into unrelated data access paths, increasing chances of unauthorized or privacy-invasive retrieval.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The CLI explicitly allows calling any AiCoin v3 endpoint, which materially exceeds the declared Hyperliquid analytics scope. In an agent-skill context, this breaks least-privilege and can enable unintended access to unrelated data domains or premium API surfaces the user did not intend to expose.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The script includes direct credential handling and persistence to .env, which is a genuine credential-access surface. In an agent skill, accepting and storing secrets is especially sensitive because it can normalize secret submission and create durable local exposure if the workspace is later leaked or misconfigured.

Content

Scanner excerpt · scripts/aicoin.mjs (reported line 7)May include surrounding context.

js
//   node scripts/aicoin.mjs <endpoint> ['<json params>']   call any v3 endpoint
//   node scripts/aicoin.mjs catalog [group|endpoint]        list endpoints (the live API menu)
//   node scripts/aicoin.mjs key                             show API key status + access probe
//   node scripts/aicoin.mjs set-key <id> <secret>           validate & save a new key to .env
//
// Endpoint = the path after /api/v3/ , e.g.  market/ticker  ,  hyperliquid/whales/open-positions
// Every call prints the v3 envelope {ok, data, error, meta}. Check `ok` first.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

A read-oriented analytics skill includes a credential capture and persistence path via set-key, storing secrets to .env. Secret collection and local persistence are high-risk capabilities, especially when unnecessary for the core advertised use, and increase the blast radius if the environment is exposed.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares executable behavior that uses environment variables and network access, but it does not constrain or disclose tool scope via an explicit permissions or allowed-tools policy. In an agent setting, that increases the risk of overbroad execution and accidental exposure of secrets or unexpected outbound requests, especially because the skill also documents credential handling and live API interaction.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The trigger description is overly broad and includes generic 'on-chain whale' and 'smart money' phrases that extend beyond Hyperliquid-specific analytics. In a multi-skill agent, this can cause misrouting, leading the agent to select a skill with broader networked capabilities and credential handling for queries that should go to a narrower or different tool, increasing the chance of unnecessary data access or unsafe execution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest markets this as a Hyperliquid analytics skill, but the documented command accepts an arbitrary API path after /api/v3/, which expands capability beyond the stated scope. That scope mismatch is dangerous because an agent may invoke unrelated endpoints, including ones with different data sensitivity or side effects, under the assumption that the skill is narrowly read-only and domain-limited.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

A read-only analytics skill includes a set-key feature that writes credentials into a local .env, which exceeds the minimum capability needed for data retrieval. This is risky because it encourages secret ingestion and persistence inside the agent environment, creating opportunities for credential mishandling, unintended reuse by other tools, or leakage through logs, workspace access, or later commands.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill proactively scans multiple .env locations and imports secrets into process.env, even though the declared use case is passive analytics. This unjustified credential-management behavior broadens access to unrelated secrets in the execution environment and can enable accidental reuse or downstream leakage if other code paths expose environment variables or write them back to disk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The client includes a function that validates and then persists API credentials into a local .env file, creating a durable secret at rest in the workspace. For a skill described as read-only analytics that reportedly does not require wallet keys, this expands the secret-handling surface unnecessarily and increases the chance of later disclosure through logs, backups, repo commits, or other tools reading the same workspace files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

saveKey updates or creates .env entries without any confirmation, preview, or warning to the user, so invoking this path silently changes persistent authentication state. This can overwrite valid credentials, plant attacker-supplied keys, or leave secrets stored in a location the user did not intend.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The returned error strings are hard-coded in Chinese ("key 验证失败" and "验证请求失败") with no indication that language is configurable or region-specific. This imposes a specific language on users without opt-in, which violates the stated language/locale policy.

Content

No source excerpt is available for this finding.