Back to skill

Security audit

okx-outcomes

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed OKX Outcomes trading helper, but it recommends unsafe mutable installer commands before using a high-impact trading CLI.

Review before installing. Prefer a pinned, signed, or checksum-verified OKX Outcomes binary instead of running curl | sh, and pin the npm CLI to the documented version. Only use this skill if you understand it can read account state and, after confirmation, place/cancel orders or split/merge/redeem outcome tokens. Never paste a private key into chat.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:41
Finding

Mutable Remote Installer Is Downloaded and Executed Without Verification

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:41, SKILL.md:271, SKILL.md:337, and references/workflows.md:204
Vulnerability Type: Remote payload retrieval and execution
Risk Level: High

Vulnerable Code

SKILL.md:41:

bash
curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh

SKILL.md:271:

text
- If the wrapper prints "okx-outcomes binary not found", **stop** and tell the user to install via `curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh`.

SKILL.md:337:

text
- **`okx-outcomes` not in PATH**: wrapper prints install hint and exits 127. Tell the user to run `curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh`.

references/workflows.md:204:

bash
curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh

Technical Analysis

The Skill repeatedly instructs users or agents to download an installer from the mutable main branch of an external GitHub repository and pipe the response directly into sh. The downloaded content is neither displayed nor saved for inspection before execution. No immutable commit, versioned release, checksum, package signature, or trusted publisher signature is verified.

Although the repository namespace is consistent with the declared OKX product, the reviewed project does not establish repository ownership or guarantee the future integrity of main/install.sh. The effective executable payload can change after this Skill has been reviewed. A compromise of the repository, maintainer account, release process, or content delivery path could consequently turn the documented installation command into arbitrary local code execution.

Direct execution of network-delivered shell content is broader than the minimum privilege required to install a known CLI artifact. A safer installation process only needs to do ...[truncated 1672 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove every curl | sh installation instruction from SKILL.md and references/workflows.md.

  2. Download an immutable, versioned release artifact from a controlled release page rather than the mutable main branch.

  3. Pin the artifact to the Skill's documented version.

  4. Publish SHA-256 checksums through a separately protected release channel and verify the downloaded artifact before installation.

  5. Prefer cryptographic signature verification using Sigstore, GPG, or an equivalent mechanism tied to an authenticated publisher identity.

  6. Separate download and execution so users can inspect the installer:

    bash
    curl -fL -o /tmp/okx-outcomes-install.sh \
      https://raw.githubusercontent.com/okx/outcomes-cli/<immutable-commit>/install.sh
    printf '%s  %s\n' '<expected-sha256>' /tmp/okx-outcomes-install.sh | sha256sum -c -
    sh /tmp/okx-outcomes-install.sh
    
  7. Prefer direct installation of a signed binary over executing an installer script.

  8. Document the files and directories the installer modifies and ensure installation does not request elevated privileges unless strictly necessary.

  9. Fail closed if checksum or signature verification fails.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:37
Finding

Globally Installed CLI Dependency Is Not Version-Pinned

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:37
Vulnerability Type: Insecure dependency installation
Risk Level: Medium

Vulnerable Code

bash
# 1. Main OKX CLI (provides the `okx outcomes` wrapper command)
npm install -g @okx_ai/okx-trade-cli

Technical Analysis

The prerequisite installs @okx_ai/okx-trade-cli globally without specifying a version. npm will therefore resolve the package version associated with the registry's current distribution tag at installation time. This means the installed executable and any package lifecycle scripts may differ from the version reviewed or expected by the Skill.

This is inconsistent with the Skill metadata, which identifies version 1.4.4:

yaml
package: "@okx_ai/okx-trade-cli@1.4.4"

The unpinned prerequisite creates a mutable supply-chain dependency. If a future package release is compromised, malicious, or behaviorally incompatible, users following the documented command may install it despite the Skill declaring and expecting version 1.4.4.

Global installation also broadens impact because the package exposes the okx executable outside an isolated project environment. npm lifecycle scripts, when present, execute with the privileges of the user running npm.

Attack Path

  1. An attacker compromises the npm publisher account, registry package, release process, or mutable distribution tag for @okx_ai/okx-trade-cli.
  2. The attacker publishes a modified package version or changes the version selected by the current tag.
  3. A user follows SKILL.md:37 and runs the unpinned global installation command.
  4. npm retrieves and installs the attacker-controlled version.
  5. Malicious lifecycle code may execute during installation, or the installed okx wrapper may intercept later Outcomes commands.
  6. The altered wrapper can observe or modify command arguments, outputs, authentication workflows, and transaction operations.

Im

...[truncated 817 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin the documented installation command to the expected version:

    bash
    npm install -g @okx_ai/okx-trade-cli@1.4.4
    
  2. Keep the prerequisite command synchronized with the version declared in Skill metadata.

  3. Verify npm package provenance and integrity metadata before installation.

  4. Review and minimize package lifecycle scripts; use --ignore-scripts where installation remains functional without them.

  5. Prefer an isolated installation mechanism over a global package when practical.

  6. Document the expected binary version and verify it immediately after installation:

    bash
    okx --version
    
  7. Treat any unexpected version as a hard failure rather than silently continuing.

  8. Establish a controlled update process that reviews new dependency versions before changing the pinned version.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (19)

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

Using a shell pipe from a network fetch directly into sh is a classic command-chaining abuse pattern because it combines retrieval and execution without inspection or integrity validation. If the fetched content is altered, the host immediately executes attacker-controlled commands, which is especially risky in an agent-enabled environment where users may follow instructions verbatim.

Content

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

md
# 2. Outcomes binary
#    macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh
#    Windows: download okx-outcomes.exe from https://github.com/okx/outcomes-cli/releases
#             and place it on your PATH.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/clob-commands.md (reported line 18)May include surrounding context.

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/ctf-commands.md (reported line 12)May include surrounding context.

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/setup-auth.md (reported line 25)May include surrounding context.

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/setup-auth.md (reported line 87)May include surrounding context.

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/setup-auth.md (reported line 173)May include surrounding context.

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/setup-auth.md (reported line 184)May include surrounding context.

text
1. --key <hex>                       (NEVER pass from chat)
2. PREDICTIONS_AGENT_PRIVATE_KEY     (env override, if set)
3. keyring entry `agent_private_key` (generated by `okx outcomes setup` / `setup bind`)
4. Test-key fallback                 (localhost / mock only)

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

Piping downloaded content directly into sh is a concrete command-chaining pattern that enables immediate execution of attacker-controlled or tampered network content. In an agent skill, this is especially dangerous because it may be carried out with little scrutiny, turning a trading assistant into a vehicle for arbitrary system-level code execution.

Content

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

md
sh --version

2. Install prebuilt binary from GitHub Releases:
   curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh

3. Verify:
   okx-outcomes --version

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The invocation examples include the generic phrase "set me up" and the catch-all condition "any authed command fails with not-signed-in." These are broad enough to overlap with ordinary user language or multiple unrelated contexts, and the file does not provide constraints or negative examples clarifying when this workflow should or should not activate.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The workflow instructs the agent/user to execute a remote installer fetched directly from the internet via curl ... | sh, which is a classic supply-chain and arbitrary code execution risk. Because this skill is meant for market operations, embedding an installation path that runs unverified remote shell code expands the trust boundary far beyond the skill's core purpose and could lead to host compromise if the script source or delivery path is tampered with.

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The skill instructs users to install software by piping a remotely fetched script directly into the shell. This is dangerous because any compromise of the source, repository, transport, or publishing workflow can lead to arbitrary code execution on the host with the user's privileges, and the skill amplifies that risk by recommending the pattern multiple times.

Content

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

md
# 2. Outcomes binary
#    macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh
#    Windows: download okx-outcomes.exe from https://github.com/okx/outcomes-cli/releases
#             and place it on your PATH.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill instructs the agent to relay a Chinese message verbatim, then separately provides an English equivalent, but it does not say to select language based on user preference or ask for opt-in. This can violate a language/locale policy requiring user choice rather than forcing a specific language in the interaction flow.

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
95% confidence
Finding

This line repeats the recommendation to execute a remotely hosted install script directly via the shell. Repetition in operational guidance increases the likelihood that agents or users will normalize and follow an unsafe installation path, resulting in arbitrary code execution if the script is ever tampered with.

Content

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

okx outcomes status --json

text

- If the wrapper prints "okx-outcomes binary not found", **stop** and tell the user to install via `curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh`.
- If `status` returns auth errors, the user isn't signed in — check `okx outcomes auth status --json` and guide them through "Setup & Onboarding" (`auth login`).

### Step 1 — Decide what's being asked

External Script Fetching

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The edge-case guidance again tells the user to run a remote script through the shell, preserving the same arbitrary code execution risk. In a security-sensitive trading skill, this is more dangerous because the installed binary may later interact with OAuth sessions, wallets, and signing flows.

Content

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

md
## Edge Cases

- **`okx-outcomes` not in PATH**: wrapper prints install hint and exits 127. Tell the user to run `curl -fsSL https://raw.githubusercontent.com/okx/outcomes-cli/main/install.sh | sh`.
- **Signing wallet missing**: any `clob create-order` / `market-order` / `ctf *` will fail. Run `okx outcomes setup bind --json` (agent-runnable), relay the **short link** (`deeplink` field, `https://okx.com/ul/3OauBX?eoa=…&uid=…`), and have the user open it (tap on phone → OKX app, or copy into a browser); if the link won't open, have them copy the wallet address and bind it manually in the OKX app (**Outcomes → Profile → Settings → API Bind Wallet**) — never ask for the key in chat.
- **Asset id vs market id mix-up**: the most common error class. `clob price/book/create-order/market-order` need `assetId`; `ctf *` and `account trades --market` need `marketId`. When unsure, run `event-markets <eventId>` first — its output lists both.
- **`--tif gtd` without `--expiry`**: rejected client-side. Pair them or default to `gtc`.

External Script Fetching

Low
Category
Supply Chain
Confidence
91% confidence
Finding

This section introduces a recovery path that depends on curl and sh, immediately leading into execution of a remote installer. Even though line 199 itself is just a prerequisite check, in context it is part of a workflow that normalizes fetching and executing external code, which increases the chance of unsafe agent-assisted system modification.

Content

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

User runs any outcomes command → wrapper prints install hint.

text
1. Confirm curl + sh available (macOS / Linux):
   curl --version
   sh --version