Back to skill

Security audit

Okx Wallet Portfolio

Security checks for vulnerabilities and agentic risk

Overview

This wallet portfolio skill needs review because it downloads and runs a remote installer/update script and its reference docs include broader wallet analytics than the stated balance-only purpose.

Install only if you are comfortable with an agent downloading and running OKX CLI installer code from GitHub and sending wallet addresses to the portfolio lookup service. A safer setup would preinstall and pin the CLI separately, then use this skill only for specific wallet-address balance checks; avoid relying on its PnL, DEX-history, or 'my wallet' examples unless that broader behavior is intended.

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

Error
Location
SKILL.md:21
Finding

Mutable Remote Installer Is Downloaded and Executed Automatically

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 21-40
Vulnerability Type: Remote payload retrieval and execution
Risk Level: High

Vulnerable Code

text
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
   and continue with step 4 (the user may be offline or rate-limited; a stale
   binary is better than blocking). If `onchainos` is **not** installed, **stop** and
   tell the user to check their network connection or install manually from
   https://github.com/okx/onchainos-skills.

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
...[truncated 3374 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not automatically download and execute an installer as part of routine portfolio queries. Require the CLI to be installed through a separate, explicit setup process.
  2. Pin the installer to a reviewed release and immutable commit identifier rather than resolving releases/latest.
  3. Verify releases using a cryptographic signature rooted in a trusted public key distributed independently with the Skill. A checksum downloaded from the same repository is not sufficient against repository compromise.
  4. Bundle a reviewed installer or binary with the package where platform and distribution policies permit it.
  5. Require explicit user confirmation before every installation or upgrade and display the version, source, destination, and permissions involved.
  6. Avoid recurring automatic updates. Provide an opt-in update command and continue using the previously verified binary by default.
  7. Download into a securely created, owner-only temporary directory using unpredictable filenames. Open files with exclusive-creation semantics and prevent symbolic-link following.
  8. Delete installer and checksum files after verification and execution, including on failure paths.
  9. Execute installation with the least-privileged account available and prohibit elevation unless separately justified and approved.
  10. Record the expected binary hash for the pinned release in trusted Skill metadata and verify the installed binary before every relevant session.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs the agent to fetch release metadata, download a remote installer script, verify it using another remotely fetched checksum file, and then execute the script locally. For a read-only wallet portfolio lookup skill, this introduces unnecessary supply-chain and local code-execution risk: a compromised release channel, repository, or network path could lead to arbitrary code execution on the host.

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 · SKILL.md (reported line 233)May include surrounding context.

md
- **Network error**: retry once, then prompt user to try again later
- **Region restriction (error code 50125 or 80001)**: do NOT show the raw error code to the user. Instead, display a friendly message: `⚠️ Service is not available in your region. Please switch to a supported region and try again.`

## Amount Display Rules

- Token amounts in UI units (`1.5 ETH`), never base units (`1500000000000000000`)
- USD values with 2 decimal places

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The reference file exposes commands for PnL analysis and DEX transaction history even though the skill metadata explicitly says this skill must not be used for PnL, DEX history, or adjacent analytics. In an agent setting, contradictory internal docs can cause tool misuse, leading the model to invoke broader surveillance/financial-analysis capabilities than the user-selected skill is supposed to permit.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The usage examples directly instruct use of this skill for 'my wallet' queries and PnL requests, contradicting the manifest’s routing restrictions. Because LLM agents heavily rely on examples, these examples can override safer skill-selection logic and cause accidental access to the wrong wallet context or unintended financial-history analysis.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

  1. Resolve latest stable version: Fetch the latest stable release tag from the GitHub API:
    text
    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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill directs the agent to execute an installer script that modifies the local system, but it does not require clear user consent or a prominent warning that software will be installed or updated. This undermines informed consent and can result in unexpected system changes, especially in environments where the user only requested a simple balance lookup.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

These instructions expand the skill from portfolio querying into local binary inspection, checksum retrieval, reinstall logic, and version-drift handling. While less severe than executing an installer, they still cause the agent to perform system-management and remote-fetch actions unrelated to the user's portfolio request, increasing attack surface and creating opportunities for unsafe host interaction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file describes commands that retrieve wallet balances, PnL, and transaction history for a supplied address, which can reveal sensitive financial and behavioral information. The document provides usage details and examples but does not warn users that querying or sharing wallet addresses may expose portfolio data and transaction history.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.