Back to skill

Security audit

Okx Dex Market

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent OKX market-data helper, but it can automatically download and run a mutable remote installer during normal use.

Review this skill before installing. Its market and wallet analysis behavior is generally disclosed, but installation can run code fetched from the OKX GitHub release path, and payment defaults may persist after confirmation. Install only if you trust the OKX release process and are comfortable with the CLI managing local state and displaying wallet financial activity.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Warning
Location
_shared/preflight.md:18
Finding
Automatic Retrieval and Execution of a Mutable Remote Installer<![CDATA[ ## Vulnerability Details **File Location**: `_shared/preflight.md`, lines 18–28 **Vulnerability Type**: Remote payload retrieval and execution with insufficiently independent integrity verification **Risk Level**: Medium ### Vulnerable Code ```markdown 2. **Install or update**: If `onchainos` is not found, or if the cache at `~/.onchainos/last_check` (`$env:USERPROFILE\.onchainos\last_check` on Windows) is older than 12 hours: - Download the installer and its checksum file from the latest release tag: - **macOS/Linux**: `curl -sSL "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.sh" -o /tmp/onchainos-install.sh` `curl -sSL "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -o /tmp/installer-checksums.txt` - **Windows**: `Invoke-WebRequest -Uri "https://raw.githubusercontent.com/okx/onchainos-skills/${LATEST_TAG}/install.ps1" -OutFile "$env:TEMP\onchainos-install.ps1"` `Invoke-WebRequest -Uri "https://github.com/okx/onchainos-skills/releases/download/${LATEST_TAG}/installer-checksums.txt" -OutFile "$env:TEMP\installer-checksums.txt"` - Verify the installer's SHA256 against `installer-checksums.txt`. On mismatch, **stop** and warn — the installer may have been tampered with. - Execute: `sh /tmp/onchainos-install.sh` (or `& "$env:TEMP\onchainos-install.ps1"` on Windows). ``` ### Technical Analysis The preflight procedure instructs the agent to determine the latest release dynamically, download an installation script from an external GitHub repository, and execute that script locally. Consequently, the effective code executed by the Skill can change after the reviewed Skill package has been published. The checksum validation reduces accidental corruption and some network-tampering risks. However, both the installer and its checksum manifest are retrieved dynamically from infrastructure controlled by the same repository owner. If ...[truncated 2932 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Separate installation from normal Skill execution** - Do not automatically download or execute an installer as part of routine market-data requests. - If the CLI is missing, stop and provide manual installation instructions. - Require explicit, informed user approval before every installation or update. 2. **Pin reviewed artifacts** - Pin a specific audited CLI and installer version instead of resolving the latest release dynamically. - Store the expected SHA-256 digest in the reviewed Skill package rather than downloading it from the same publishing boundary as the executable. - Update the pinned version and digest only through a reviewed Skill release. 3. **Use cryptographic release signatures** - Require signed release metadata or artifacts. - Pin the trusted signing public key or certificate independently in the Skill. - Reject unsigned releases, invalid signatures, unexpected signers, and rollback attempts. 4. **Avoid executing installer scripts where possible** - Prefer a platform package manager with signature verification and version pinning. - Alternatively, download a platform-specific binary, verify it against independently trusted metadata, and install it without running a general-purpose shell script. 5. **Secure temporary-file handling** - Create a private temporary directory with restrictive permissions using `mktemp -d` or an equivalent secure API. - Reject symbolic links and ensure files are owned by the current user. - Verify and execute the same immutable file descriptor or securely rename the verified artifact to prevent time-of-check/time-of-use replacement. - Delete temporary artifacts after completion. 6. **Constrain installer privileges** - Never invoke `sudo`, request administrator access, or write outside a narrowly defined user-owned installation directory. - Run installation in a sandbox with restricted filesystem and network access where su ...[truncated 343 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
- **`portfolio-token-pnl` `isPnlSupported = false`**: PnL calculation is not supported for this token/chain combination
- **Network error**: retry once, then prompt user to try again later

## Amount Display Rules

- Always display in UI units (`1.5 ETH`), never base units
- Show USD value alongside (`1.5 ETH ≈ $4,500`)
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Natural-Language Policy Violations

Medium
Confidence
83% confidence
Finding
The instruction says that if the user's query contains Chinese text, the agent should read a separate glossary for keyword-to-command mappings. This creates language-specific behavior triggered solely by detected language, without offering the user a choice or documenting an opt-in.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
The skill metadata and top-level routing instructions explicitly say WebSocket scripts/bots should be routed to a different skill, yet this file includes concrete WebSocket commands and points users to a WebSocket protocol reference. That contradiction can cause misrouting and policy bypass, especially if an orchestrator or downstream agent follows the embedded operational instructions instead of the declared boundary.

External Transmission

Medium
Category
Data Exfiltration
Content
1. **Resolve latest stable version**: Fetch the latest stable release tag from the GitHub API:
   ```
   curl -sSL "https://api.github.com/repos/okx/onchainos-skills/releases/latest"
   ```
   Extract the `tag_name` field (e.g., `v1.0.5`) into `LATEST_TAG`.
   If the API call fails and `onchainos` is already installed locally, skip steps 2-3
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
This markdown file documents commands that retrieve wallet portfolio overview, DEX transaction history, and recent/token PnL for a supplied wallet address. The descriptions explain the data returned but do not warn users that these commands may surface sensitive financial activity and trading history, which falls under markdown-file missing user warnings for privacy-affecting behavior.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The single-entry confirmation flow explicitly instructs asking the user to confirm with `yes` / `proceed` / `确认`, which introduces a Chinese-language response token alongside English without any stated locale policy or user language selection. This can be a natural-language policy concern because the skill mixes language-specific interaction requirements without documenting user choice or regional justification.

Static analysis

No suspicious patterns detected.