Back to skill

Security audit

Coinw Contract Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent CoinW futures API reference, but it asks users to handle crypto trading credentials and high-impact trading actions in ways that need careful review.

Install only if you are comfortable giving an agent access to CoinW futures-account data and trading authority. Prefer read-only keys where possible, never paste API secrets into chat, do not enable withdrawal permission for this skill, use IP allowlisting and least-privilege API permissions, and confirm every order, close, reverse, or margin-changing action before execution.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T08 · Insecure Dependencies

Error
Location
Readme.md:27
Finding

Unpinned Remote Dependencies Executed During Installation

Content
View full analysis

Vulnerability Details

File Location: Readme.md:27-30
Vulnerability Type: Unpinned third-party package and mutable GitHub dependency
Risk Level: High

Complete Code Snippet:

markdown
### Install coinw-skills

Run the following command to add coinw-skills to your project:

```bash
npx skills add https://github.com/connectCoinw/coinw-skills
text

### Technical Analysis

The installation command invokes `npx` without pinning the `skills` package to a specific version. Depending on the local environment, `npx` may download and execute the current package version from the npm registry. The GitHub repository is also referenced without an immutable commit hash or signed release identifier.

Consequently, the code executed during installation is not fully determined by the audited project contents. A later package update, compromised publisher account, repository compromise, or malicious dependency substitution could alter the effective installation payload after review.

### Attack Path

1. An attacker compromises the npm package, its publisher account, the referenced GitHub repository, or a relevant supply-chain component.
2. The attacker publishes or commits a malicious payload under the mutable package or repository reference.
3. A user follows the documented installation command.
4. `npx` retrieves and executes the current package version, which processes content from the mutable repository reference.
5. The malicious payload executes with the privileges of the user running the command.

### Impact Assessment

Successful exploitation could permit arbitrary code execution under the installing user's account. Depending on that account's privileges and environment, an attacker could access project files, environment variables, CoinW API credentials, local credential stores, or other user-accessible resources. The project does not itself contain the remote payload, so the final impact depends on wha
...[truncated 40 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin the npm utility to a reviewed version, such as npx skills@<exact-version>.
  • Pin the GitHub source to an immutable commit hash rather than a mutable branch or repository head.
  • Prefer signed release artifacts and publish their cryptographic checksums.
  • Use a lockfile and integrity metadata for all transitive dependencies.
  • Run installation in a restricted environment without production credentials.
  • Document a process for verifying package signatures, commit provenance, and artifact hashes before installation.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:20
Finding

API Secret Keys Are Requested Through Chat

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:20-24
Additional Locations: SKILL.md:172-178, Readme.md:33-35
Vulnerability Type: Plaintext sensitive credential exposure
Risk Level: High

Complete Code Snippet:

markdown
1. Environment variables:
```bash
export COINW_API_KEY="your_api_key"
export COINW_SECRET_KEY="your_secret_key"
  1. In chat: provide api_key/secret_key (and an account name). The agent will mask secrets when showing them back and store them securely in OpenClaw's credential storage (not inside skill markdown files).
text

The behavior is reinforced later in the same file:

```markdown
## Adding New Accounts

When user provides new credentials:

* Ask for account name, api_key, secret_key
* Store the provided credentials in OpenClaw's secure credential store with masked display confirmation

The README also permits direct chat submission:

markdown
For CoinW Skills, certain endpoints require you to provide CoinW API credentials. You can do this by setting environment variables, using a secrets file (such as `.env` or `.openclaw/secrets.env`), or sending them directly to the agent in the chat.

Technical Analysis

The instructions explicitly ask users to place API and secret keys into a chat conversation. Masking the key when displaying it later does not redact the original plaintext message. Chat content may be retained in conversation history, application logs, telemetry, debugging traces, backups, or model-provider records.

The audited project contains documentation only and does not include a verifiable implementation of the claimed secure credential-storage or prompt-redaction behavior. Therefore, the assertion that credentials will subsequently be stored securely does not mitigate their initial exposure through the conversation channel.

Attack Path

  1. The Skill asks the user for an account name, API key, and secret key.

...[truncated 903 chars]

Remediation
View remediation

Remediation Suggestions

  • Prohibit users from submitting API or secret keys through chat.
  • Accept only references to credentials already stored in an approved secret manager.
  • Retrieve credentials directly at tool-execution time without inserting their values into the model prompt or conversation.
  • Use protected environment variables only where process isolation and log redaction are enforced.
  • Remove recommendations to use ordinary .env files unless strict permissions, exclusion from version control, and encryption requirements are documented.
  • Apply automatic secret detection and redaction to prompts, logs, traces, errors, and telemetry as defense in depth.
  • Clearly document credential retention, deletion, encryption, and access-control policies.
  • Encourage users to rotate any key that has already been posted in chat.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/error-codes.md:19
Finding

Troubleshooting Guidance May Cause Unnecessary Withdrawal Privileges

Content
View full analysis

Vulnerability Details

File Location: references/error-codes.md:19-31
Additional Location: references/api-key-creation-steps.md:16-18
Vulnerability Type: Excessive API permissions and violation of least privilege
Risk Level: High

Complete Code Snippet:

markdown
### 6003 Insufficient Permissions (Futures)

```json
{"code": 6003, "message": "require more permission", "retry": false, "success": false}

This error indicates that the current API Key does not have the required permissions enabled.

Troubleshooting Suggestions:

  1. Confirm that the API Key is correct, activated, and has the necessary permissions enabled.
  2. Log in to the CoinW user backend and enter the "API Management" page.
  3. Edit the current API Key and enable the corresponding permissions (such as futures trading, read-only, withdrawal, etc.).
  4. Save the changes and retest the request.
  5. If the problem persists, please contact customer support.
text

The API-key creation guide additionally states:

```markdown
6. By default, newly created API keys only have read-only access, and trading functionality is disabled. To enable trading, click "Edit" and select the necessary permissions.
7. By default, the user account has "Spot Trading" enabled. However, to activate "Futures Trading", the user must agree to the terms in the pop-up window when enabling "Futures Trading" for the API key.
8. To enable the "Withdrawal" option for the API, the user must configure an IP whitelist.

Technical Analysis

This Skill is designed for futures market data, trading, order management, positions, and account queries. No documented Skill operation requires cryptocurrency withdrawal permission. Nevertheless, the generic insufficient-permission troubleshooting procedure explicitly presents withdrawal permission as an example of a permission users may enable.

This advice can cause users to grant authority beyond the Ski ...[truncated 1309 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove withdrawal permission from generic troubleshooting guidance.
  • Explicitly state that this Skill does not require and must not use withdrawal permission.
  • Map every private endpoint to the exact minimum CoinW permission it requires.
  • When error 6003 occurs, identify the failed endpoint and recommend only its specific missing permission.
  • Recommend separate keys for read-only access and futures trading.
  • Require IP allowlisting for trading keys where supported.
  • Encourage short credential lifetimes, regular rotation, and immediate revocation after suspected disclosure.
  • Add a preflight check that reports missing permissions without requesting unrelated privileges.

T09 · Insecure Skill Coding Practices

Warning
Location
references/error-codes.md:218
Finding

Support Guidance Requests Complete Authenticated Commands Without Redaction

Content
View full analysis

Vulnerability Details

File Location: references/error-codes.md:218-229
Vulnerability Type: Sensitive information disclosure through diagnostic material
Risk Level: Medium

Complete Code Snippet:

markdown
## For Further Assistance

If the above steps fail to resolve your issue, please contact the CoinW API support team and provide the following information to expedite processing:

| Field | Description |
|-------|-------------|
| Spot/Futures | |
| API interface address | |
| Complete request command | |
| Request method | |
| User ID | |
| Complete CoinW return | |
| Timestamp | |
| IP | |
| Customer's description of the problem | |
| Screenshots or logs (if any) | |

Technical Analysis

A complete authenticated request command may contain the API key header, signature, timestamp, request body, order identifiers, account details, and trading parameters. Complete API responses, screenshots, and logs may also reveal balances, positions, user identifiers, IP addresses, or other sensitive metadata.

The guidance does not require users to redact authentication headers, signatures, cookies, tokens, account identifiers, or sensitive response fields before submitting the material. Even if a request signature has a short validity period, the API key and accompanying account information remain sensitive, and diagnostic records may be retained in ticketing or support systems.

Attack Path

  1. A user encounters an API error that is not resolved by the documented troubleshooting steps.
  2. The user follows the support instructions and copies a complete private request command, response, screenshot, or log.
  3. Authentication headers, account identifiers, financial data, or other sensitive fields remain in the submitted material.
  4. The support ticket, email, log archive, or screenshot becomes accessible to an unauthorized party through excessive internal access, accidental sharing, or ...[truncated 723 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace the request for a “Complete request command” with a sanitized diagnostic template.
  • Require removal of api_key, sign, secret keys, cookies, bearer tokens, session identifiers, and authorization headers.
  • Redact user IDs, IP addresses, order IDs, balances, positions, and sensitive request or response fields unless strictly necessary.
  • Provide explicit safe examples showing placeholders such as <REDACTED_API_KEY>.
  • Generate a minimal reproducible request that omits credentials and financial data.
  • Warn users not to submit .env files, terminal history, raw debug traces, or unedited screenshots.
  • Apply automated secret scanning and access controls to support-ticket attachments and logs.
  • Define secure retention and deletion periods for diagnostic material.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

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

md
## Authentication

For CoinW Skills, certain endpoints require you to provide CoinW API credentials. You can do this by setting environment variables, using a secrets file (such as `.env` or `.openclaw/secrets.env`), or sending them directly to the agent in the chat.

For more details, see the Security section in each skill.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Telling users they may send CoinW API credentials directly to the agent in chat is unsafe because chat channels may be logged, retained, exposed to third-party model providers, or inadvertently reused in future context. This is especially dangerous in a crypto trading skill because API keys can enable account access, order placement, balance queries, or fund loss depending on key scope.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
85% confidence
Finding

The README instructs users to run npx skills add without pinning a specific package version or commit, which creates a supply-chain risk if the referenced package or its resolution path changes or is compromised. In an agent-skills ecosystem, installation commands are highly trusted and likely to be copy-pasted, so unpinned execution increases exposure to unexpected or malicious code.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest enables the skill with always: true, meaning a trading-capable skill can be activated broadly without explicit trigger constraints. In the context of private exchange APIs and order/position endpoints, this increases the chance of accidental invocation and unintended use of stored credentials for sensitive account actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill documents destructive actions such as closing all positions, reversing positions, and adjusting margin, but the operational risk warning is minimal relative to the financial impact of those commands. In a live trading skill, insufficient warnings and safeguards can lead to irreversible losses from accidental or misunderstood requests.

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 120)May include surrounding context.

md
### Auth and URL
- Base URL: `https://api.coinw.com`.
- Public market endpoints are mostly `GET https://api.coinw.com/v1/perpum/...` or `.../v1/perpumPublic/...`.
- Private endpoints require header-based auth: `api_key`, `timestamp`, `sign` (HMAC-SHA256 then Base64, see Reference).
### Common request fields
- **instrument** / **name**: contract identifier (often mixed in docs; means underlying/contract name).

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 147)May include surrounding context.

md
### Auth and URL
- Base URL: `https://api.coinw.com`.
- Public market endpoints are mostly `GET https://api.coinw.com/v1/perpum/...` or `.../v1/perpumPublic/...`.
- Private endpoints require header-based auth: `api_key`, `timestamp`, `sign` (HMAC-SHA256 then Base64, see Reference).
### Common request fields
- **instrument** / **name**: contract identifier (often mixed in docs; means underlying/contract name).

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The support escalation template asks users to provide complete request commands, user ID, full API responses, timestamps, IP addresses, and screenshots/logs without any guidance to redact API keys, secrets, auth headers, cookies, or other sensitive account data. In an API/integration skill, this creates a realistic risk of credential or personal data oversharing to support channels, which can lead to account compromise or privacy exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The file includes raw Chinese-language error text in examples such as "用户api出错" while the rest of the document is in English, and it does not provide a translated user-facing alternative at that point. This can create a language-policy issue because the skill presents a specific language without explicit user opt-in or immediate localization support.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The example response contains the Chinese-only message "仓位不存在或已平仓" in an otherwise English document, with no language preference or localization note. Presenting untranslated messages can conflict with language-choice expectations when the document otherwise assumes English readers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The response example uses the Chinese message "暂停交易" without an adjacent translation or explanation in the code block context. Even if the following prose explains the meaning, the document still surfaces a fixed non-English message without explicit language choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The example contains the Chinese string "业务异常" while the document otherwise targets English readers and does not explain that upstream responses may be localized. This may violate language/locale expectations by presenting a fixed language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The long example error message is presented only in Chinese in an English-language reference, without an explicit statement that the original upstream API response is being quoted verbatim. That can be a language-policy concern because users are not given a language choice or immediate localized text in the example itself.

Content

No source excerpt is available for this finding.