Back to skill

Security audit

okx-cex-trade

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marked this skill suspicious because its instructions appear to go beyond its stated trading purpose, including market analysis and event discovery; the scan was partial, so its evidence is incomplete.

Consider the suspicious verdict and scope mismatches before installing. The scan covered 7 of 9 components fully, with two partially inspected, and the tool-poisoning analysis was degraded; the evidence is therefore incomplete and does not establish that the skill is safe.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The supplied command retrieves event-market listings rather than placing or managing orders. Although event contract trading is declared, this standalone market-discovery capability falls within the explicitly excluded market-data scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The supplied chunk documents an event-listing command, not an order-management command. Although discovering events can support event-contract trading, this command's direct purpose is information retrieval, which falls on the market-data side of the description's explicit exclusion. This assessment is limited to the supplied chunk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

The supplied chunk only runs configuration and authentication inspection commands; it performs no trading or order-management operations. Authentication checks could support the declared purpose, but displaying credential-profile configuration and session state as the entirety of the supplied behavior is materially different from executing trades. The code does not demonstrate external exfiltration or establish that raw secret values are exposed.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · references/event-workflows.md (reported line 3)May include surrounding context.

md
# Event Contract Workflows — Multi-Step Trading Scenarios

> **Display rule**: When presenting tool results to users, always use user-facing labels
> (e.g., "Order number", "Contract", "Fill price"), not raw API field names
> (e.g., `ordId`, `instId`, `fillPx`).

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
### Error-suggested remediation safeguard

When an OKX API error message suggests a fix that involves **write operations** (cancel orders, close positions, stop bots/strategies, transfer funds, etc.), you **MUST NOT** automatically execute those actions. Instead:

1. **Report** the error and its suggestion to the user verbatim
2. **Diagnose** — run read-only queries to identify what is blocking (e.g., `algo-orders --status pending`, `positions`, `bot grid-orders --status active`)

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
## Global Notes

- All write commands require valid credentials (OAuth session or API key in `~/.okx/config.toml`)
- Auth method and trading mode are determined in "Credential & Profile Check"; see that section for parameter rules
- `--json` returns the raw OKX API v5 response by default. Add `--env` to wrap the output as `{"env": "<live|demo>", "profile": "<name>", "data": <response>}` — useful when you need to know the active environment and credential profile
- Rate limit: 60 order operations per 2 seconds per UID

The direction-analysis workflow performs market-data analysis despite the manifest explicitly excluding market-data requests.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

The manifest says not to use this skill for market data and assigns that scope to okx-cex-market. However, L067–L082 instruct the agent to fetch underlying-asset candles through okx market index-candles, analyze trends and momentum, and recommend UP or DOWN even before the user has chosen a trade. This is a standalone market-analysis workflow rather than an instrument lookup needed to execute an order.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/event-workflows.md (reported line 135)May include surrounding context.

  • Infer expiry from the instrument ID (instId, API field):
    • price_above / price_once_touch: YYMMDD-HHMM → e.g. 260320-1600 = 2026-03-20 16:00 UTC+8
    • price_up_down: YYMMDD-START-END → expiry is the END time
  • If expired → immediately run without asking:
    text
    okx event markets <seriesId> --state expired
    

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/event-workflows.md (reported line 175)May include surrounding context.

User: "Cancel order EVT-ORDER-001" / "Cancel my order 800000024"

okx event cancel requires both the instrument ID and Order number. If the user only provides the Order number, look up the instrument ID first — never ask the user for it.

text
Step 1: okx event orders --status open

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

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

md
3. **Present findings** — show the user what was found and which specific items would need to be cancelled/closed/stopped
4. **Wait for explicit confirmation** before executing any remediation

This applies to all error codes whose messages suggest destructive actions, including but not limited to:
- Set-leverage blocked by pending algo orders or active bots
- Account setting changes requiring order/position/strategy cleanup (e.g., error codes 59000, 59002, 59007)
- Margin mode switches requiring position closure

The leverage workflow routes bot inspection through the trade skill despite the manifest's explicit exclusion of bots.

Low
Category
Excessive Agency
Confidence
97% confidence
Finding

L42 instructs okx-cex-trade to execute okx bot grid-orders --type contract_grid --status active, which retrieves active trading bots. Although this supports troubleshooting a leverage change, the manifest explicitly excludes bots and directs that functionality to okx-cex-bot; the workflow crosses that stated boundary.

Content

No source excerpt is available for this finding.