Back to skill

Security audit

okx-cex-market

Security checks for vulnerabilities and agentic risk

Overview

This is mostly a read-only OKX market-data skill, but the unpinned global CLI install and inconsistent event-contract scope warrant review before installation.

Before installing, prefer a pinned or local install of @okx_ai/okx-trade-cli@1.4.6 and review the package source or published contents if possible. Treat this skill as market-data only, do not provide credentials, and use separate portfolio or trade skills for account access or orders.

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 Global Installation of an Executable npm Dependency## Vulnerability Details **File Location**: `SKILL.md`, line 39 **Vulnerability Type**: Unpinned third-party executable dependency **Risk Level**: Medium **Complete Code Snippet**: ```bash npm install -g @okx_ai/okx-trade-cli okx market ticker BTC-USDT # verify ``` The installation instruction conflicts with the version-pinned package declaration elsewhere in the same file: ```yaml install: - id: npm kind: node package: "@okx_ai/okx-trade-cli@1.4.6" bins: ["okx"] label: "Install okx CLI (npm)" ``` ### Technical Analysis The documented installation command does not specify a package version. Consequently, npm resolves whichever release is tagged as current at installation time rather than the declared and potentially reviewed version `1.4.6`. Installing an npm package can execute package lifecycle scripts, while subsequent use executes the package-provided `okx` binary. Because the package implementation is not included in the audited project, its actual behavior—including network destinations, local-data access, credential handling, and adherence to the claimed read-only model—cannot be verified from this artifact. The global `-g` installation increases exposure by placing the executable in a system- or user-wide command path. This is broader than necessary for invoking a project-scoped market-data utility and creates a supply-chain trust boundary outside the reviewed Skill. ### Attack Path 1. An attacker compromises the npm package publisher account, release pipeline, package namespace, or a newly published package version. 2. The attacker publishes a malicious version under `@okx_ai/okx-trade-cli` or changes the package version referenced by the mutable distribution tag. 3. A user follows the instruction in `SKILL.md` and runs: ```bash npm install -g @okx_ai/okx-trade-cli ``` 4. npm retrieves the attacker-controlled current release rather than the declared version ...[truncated 1270 chars]
Remediation
## Remediation Suggestions 1. Pin the installation command to the exact version declared in the Skill metadata: ```bash npm install -g @okx_ai/okx-trade-cli@1.4.6 ``` 2. Prefer a project-local installation over a global installation: ```bash npm install --save-exact @okx_ai/okx-trade-cli@1.4.6 ``` Invoke the local binary through a controlled package script or an explicitly pinned execution mechanism. 3. Commit and enforce an npm lockfile with integrity hashes where the hosting format permits it. Use reproducible installation commands such as `npm ci`. 4. Audit the dependency source, transitive dependency graph, published package contents, and npm lifecycle scripts before approving execution. 5. Disable lifecycle scripts during installation when they are not required: ```bash npm install --save-exact --ignore-scripts @okx_ai/okx-trade-cli@1.4.6 ``` This should only be used after confirming that the package does not legitimately require installation scripts. 6. Keep the metadata package version and every human-readable installation example synchronized. Add automated validation to reject unpinned installation commands. 7. Execute the CLI under a least-privileged account or sandbox with access limited to required public market-data endpoints and without unnecessary access to credentials or sensitive local files.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (4)

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The manifest and routing text repeatedly state that event-contract use belongs to a different skill and that this skill should not serve event contracts. However, the command index and instrument-listing documentation explicitly include `EVENTS` support and describe how to discover event instruments, which expands the skill beyond the stated market-only non-event scope.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
Lines L093-L103 clearly direct the agent to stop and route event-contract requests elsewhere, but lines L118-L119 immediately document `EVENTS` instrument listing and tell the user to run `okx event series` to discover series IDs. This is an active contradiction in the skill's own documentation about whether event-related functionality belongs here.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
### Step 2 — Run commands immediately

All market data commands are read-only — no confirmation needed.

### Step 3 — No writes, no verification needed
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
All market data commands are read-only — no confirmation needed.

### Step 3 — No writes, no verification needed

All commands in this skill are read-only.
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.

Static analysis

No suspicious patterns detected.