Back to skill

Security audit

Storyclaw X2c Publish

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for X2C publishing and wallet use, but it handles powerful credentials and wallet-moving actions without enough endpoint or confirmation safeguards.

Install only if you trust the X2C API setup and can enforce the official HTTPS endpoint. Use narrowly scoped API keys, protect any credential file from other users and version control, and require explicit confirmation of amount, asset, network, fees, and full destination address before any swap or withdrawal.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:53
Finding
API Credential Exposure Through a User-Controlled API Base URL<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:53-68` **Vulnerability Type**: Credential disclosure through an unvalidated remote endpoint **Risk Level**: High ### Vulnerable Code ```markdown ### API Endpoint All requests go to the X2C Open API. The base URL is configured via `X2C_API_BASE_URL` env var or defaults to the production endpoint. Headers: - `Content-Type: application/json` - `X-API-Key: <your_x2c_api_key>` ### Get Categories ```bash curl -m 60 -X POST "$X2C_API_BASE_URL" \ -H "Content-Type: application/json" \ -H "X-API-Key: $X2C_API_KEY" \ -d '{"action": "distribution/categories", "lang": "zh-CN"}' ``` ``` ### Technical Analysis The skill instructs the agent to obtain the request destination directly from the `X2C_API_BASE_URL` environment variable and attach the sensitive `X2C_API_KEY` credential to requests sent to that destination. The supplied project does not define the expected production endpoint, require HTTPS, validate the hostname, or establish an allowlist of trusted origins. An attacker who can influence the environment variable or relevant OpenClaw configuration can redirect requests to a server under their control. Because the API key is sent in a request header, the attacker-controlled server can capture it without needing to intercept encrypted traffic. The same request pattern is documented for publishing and wallet functionality. A stolen key may therefore expose all capabilities granted to that credential rather than only the category endpoint shown above. ### Attack Path 1. The attacker influences `X2C_API_BASE_URL` through environment configuration, deployment configuration, or another configuration injection vector. 2. The value is changed to an attacker-controlled HTTP or HTTPS endpoint. 3. A user invokes any documented X2C operation. 4. The agent executes `curl` and attaches `X2C_API_KEY` to the request. 5. The attacker-controlled endpoint records the `X-API-Key` header. 6. The attacker reu ...[truncated 612 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Hard-code the official X2C HTTPS API origin when runtime endpoint customization is unnecessary. 2. If configuration is required, validate the URL before adding credentials: - Require the `https` scheme. - Require an exact approved hostname and port. - Reject embedded credentials, unexpected paths, IP-literal hosts, and unapproved subdomains. 3. Configure `curl` to reject unsafe redirects or disable redirects entirely. If redirects are required, ensure credentials are never forwarded to another origin. 4. Do not send the API key until endpoint validation has succeeded. 5. Document the canonical production endpoint in the skill rather than relying on an unspecified default. 6. Use narrowly scoped API credentials and separate publishing permissions from wallet or withdrawal permissions. 7. Rotate the API key immediately if it may previously have been transmitted to an untrusted endpoint. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:182
Finding
Asset Swaps and Withdrawals Lack Mandatory Transaction Confirmation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:182-198` **Vulnerability Type**: Unsafe execution of financially sensitive operations **Risk Level**: High ### Vulnerable Code ```markdown ### Swap X2C to USDC ```bash curl -m 60 -X POST "$X2C_API_BASE_URL" \ -H "Content-Type: application/json" \ -H "X-API-Key: $X2C_API_KEY" \ -d '{"action": "wallet/swap-x2c", "amount": 100.0}' ``` ### Withdraw USDC ```bash curl -m 60 -X POST "$X2C_API_BASE_URL" \ -H "Content-Type: application/json" \ -H "X-API-Key: $X2C_API_KEY" \ -d '{"action": "wallet/withdraw-usdc", "amount": 10.0, "to_address": "SolanaAddress..."}' ``` ``` ### Technical Analysis The skill provides direct instructions for asset conversion and withdrawal but does not require a fresh, explicit user confirmation immediately before executing either operation. It also does not require the agent to display and verify the final asset, amount, destination address, blockchain network, expected fees, exchange result, or irreversible nature of the transaction. Financial transaction parameters can originate from ambiguous user instructions, stale conversational context, copied content, or attacker-influenced data. Without a mandatory confirmation boundary, the agent can execute a materially different or unintended transaction while still following the documented workflow. No amount limit, destination allowlist, address validation step, transaction preview, or separate authorization mechanism is documented. The existing instruction not to retry failed requests reduces duplicate-request risk but does not prevent an incorrect first transaction. ### Attack Path 1. An attacker or untrusted document introduces a withdrawal address or transaction amount into the conversation or task context. 2. The agent interprets that value as the requested wallet operation. 3. The agent constructs the documented `wallet/swap-x2c` or `wallet/withdraw-usdc` request. 4. The request is submitted without prese ...[truncated 900 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require explicit user confirmation immediately before every swap or withdrawal. 2. Present a transaction summary containing: - Operation type. - Source and destination assets. - Exact amount. - Destination address. - Blockchain network. - Estimated fees. - Expected received amount or exchange rate. - A warning that blockchain withdrawals may be irreversible. 3. Treat transaction parameters from external content, tool output, and prior conversation context as untrusted until the user confirms them. 4. Validate destination-address syntax and ensure it is valid for the explicitly selected network. 5. Require the user to confirm a normalized full address rather than a shortened or partially displayed value. 6. Apply configurable per-transaction and daily limits, with stronger authorization for high-value transactions. 7. Use idempotency keys where supported and query transaction status before allowing another mutation. 8. Prefer separate, narrowly scoped credentials for read-only wallet operations, swaps, and withdrawals. 9. Consider destination allowlisting, multi-factor approval, or out-of-band confirmation for withdrawals. ]]>
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 (5)

External Transmission

Medium
Category
Data Exfiltration
Content
## Critical Rules

- Complete ALL workflow steps in order — never skip steps
- Always add timeout to curl commands: `-m 60`
- NEVER retry failed requests — report error and ask user
- Check project status before publishing to avoid duplicates
- Cover URL must be an image (jpg/png/webp), never a video URL
Confidence
60% 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
94% confidence
Finding
The skill instructs users to store an API key in a local JSON file but does not warn that the key is a secret requiring filesystem protections. This can lead to credential exposure through weak file permissions, accidental commits, backups, or multi-user system access, which could let an attacker publish content or perform wallet operations via the API.

External Transmission

Medium
Category
Data Exfiltration
Content
### Query Status

```bash
curl -m 60 -X POST "$X2C_API_BASE_URL" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $X2C_API_KEY" \
  -d '{"action": "distribution/query", "project_id": "uuid"}'
Confidence
60% 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
95% confidence
Finding
The wallet section documents asset-moving operations such as claim, swap, and withdrawal without any explicit warning that these actions may be irreversible and have financial consequences. In an agent skill context, this increases the risk of accidental or insufficiently confirmed transfers, especially because the skill exposes direct API calls that can move funds off-platform.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
The example request for categories sets `"lang": "zh-CN"` directly, which implies a fixed language/locale choice. There is no nearby explanation that the skill is region-specific or that the user can choose a different locale, so this appears to violate the language/locale policy requirement.

Static analysis

No suspicious patterns detected.