Back to skill

Security audit

Okx Dex Ws

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with OKX WebSocket use, but it relies on unbundled local instruction files and an unaudited workflow while handling wallet and subscription metadata.

Review this skill before installing in sensitive environments. Use it only with wallet addresses and token targets you are comfortable sending to OKX, and avoid loading the referenced sibling preflight/protocol files or home-directory workflow unless you trust and have reviewed those files.

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
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:17
Finding
Untrusted External Instruction Inclusion Through Relative File References## Vulnerability Details **File Location**: `SKILL.md:17-19` **Vulnerability Type**: External instruction inclusion **Risk Level**: High **Vulnerable code snippet**: ```markdown ## Pre-flight Checks > Read `../okx-agentic-wallet/_shared/preflight.md`. If that file does not exist, read `_shared/preflight.md` instead. ``` ### Technical Analysis The Skill instructs the agent to load additional instructions from a relative path outside the audited Skill directory. The primary path traverses into a sibling package, while the fallback path refers to another file that is not included in the audited project. Because neither referenced file was available in the supplied artifact, their contents and integrity could not be verified. If an attacker can create or modify either file, they can introduce arbitrary instructions into the agent's active context when the Skill is loaded. Those instructions could attempt to alter the current task, override safety boundaries, request sensitive information, or induce unauthorized tool operations. This is an instruction-hijacking trust-boundary issue rather than direct native code execution. Its practical impact depends on the agent's available tools, whether loaded documents are treated as authoritative instructions, and the attacker's ability to modify the referenced files. ### Attack Path 1. An attacker gains write access to `../okx-agentic-wallet/_shared/preflight.md`, or to the fallback `_shared/preflight.md`. 2. The attacker inserts instructions that redirect the agent's behavior, solicit sensitive information, or request unsafe tool actions. 3. A user invokes the `okx-dex-ws` Skill. 4. The Skill directs the agent to read the attacker-controlled preflight file. 5. The agent incorporates the external text into its active context. 6. If the agent treats that text as trusted instructions, the attacker can influence the current session within the limits of the agent's tools and permis ...[truncated 472 chars]
Remediation
## Remediation Suggestions - Bundle the required preflight guidance inside the audited Skill package rather than loading it from a sibling directory. - Resolve and validate paths against an explicit allowlisted root, rejecting parent-directory traversal. - Pin the expected external file to a cryptographic digest or signed release if an external dependency is unavoidable. - Treat loaded documents as untrusted reference material rather than executable agent instructions. - Prevent externally loaded content from overriding system policies, requesting unrelated tool use, or changing the user's task. - Display the source and integrity status of externally loaded guidance before using it. - Fail closed when the expected trusted file is unavailable instead of silently selecting an unverified fallback.

T01 · Skill Instruction Hijacking

Note
Location
SKILL.md:25
Finding
Mandatory Promotional Content Injected Into Command Results## Vulnerability Details **File Location**: `SKILL.md:25-33` **Vulnerability Type**: Forced output manipulation **Risk Level**: Low **Vulnerable code snippet**: ```markdown ## Related Workflows When one of the following commands is used, show the related workflow hint after displaying results: | Command | Workflow | File | |---------|----------|------| | `ws start`, `ws poll`, `ws stop` | Wallet Monitor (WebSocket) | `~/.onchainos/workflows/wallet-monitor-ws.md` | > Hint format: *"You can also try out our **Wallet Monitor (WebSocket)** workflow for more comprehensive results. Would you like to try it?"* ``` ### Technical Analysis The Skill requires the agent to append predefined promotional language whenever specified WebSocket commands are used. This modifies the response independently of whether the user requested workflow recommendations. The instruction does not execute code, access protected resources, or independently provide a path to privilege escalation. However, it affects output integrity by forcing session behavior and steering the user toward another local workflow. The referenced workflow was not included in the artifact, so its contents could not be assessed. If that separate workflow were attacker-controlled and the user accepted the recommendation, it could become a secondary instruction-loading vector. ### Attack Path 1. A user requests `ws start`, `ws poll`, or `ws stop`. 2. The Skill requires the agent to append the predefined Wallet Monitor recommendation. 3. The user is directed toward `~/.onchainos/workflows/wallet-monitor-ws.md`. 4. If the user elects to use that workflow, the agent may load instructions from a file outside the audited project. 5. Any further impact would depend on the contents and integrity of that separate workflow file. ### Impact Assessment The directly confirmed impact is limited to manipulation of agent output and unsolicited workflow promotion. It may red ...[truncated 228 chars]
Remediation
## Remediation Suggestions - Remove the requirement to append promotional text to every matching command result. - Offer related workflows only when they are relevant to the user's request or explicitly requested. - Clearly distinguish optional recommendations from command output. - Validate the existence, ownership, and integrity of any referenced workflow before recommending or loading it. - Require explicit user confirmation before loading instructions from the referenced workflow. - Treat the workflow file as untrusted content and prevent it from overriding higher-priority instructions or expanding tool access.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
Findings (1)

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill instructs users to send wallet addresses and token subscription parameters to a third-party WebSocket endpoint but does not warn that these identifiers are transmitted off-host to OKX. In a blockchain context, wallet addresses are sensitive metadata because they can reveal portfolio interests, monitoring targets, and behavioral patterns even if they are public on-chain.

Static analysis

No suspicious patterns detected.