Back to skill

Security audit

Bitget Data

Security checks for vulnerabilities and agentic risk

Overview

This Bitget trading skill is purpose-aligned, but it ships live-looking credentials, defaults examples to live trading, can place or cancel real orders without strong safeguards, and can add persistent OpenClaw cron behavior.

Review this skill carefully before installing. Do not run it with real exchange credentials unless you have replaced the shipped credential files, confirmed API permissions and IP restrictions, and are comfortable with scripts that can place market/limit orders, cancel existing orders, and create persistent OpenClaw reminders. Prefer paper trading or simulation first, and remove or disable cron setup unless you explicitly want recurring agent-session activity.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
config.json:2
Finding
Plaintext Bitget API credentials committed in multiple project files<![CDATA[ ## Vulnerability Details **File Location**: `config.json:2-5`; duplicated in `multi_agent_config.json:6-11` and `MULTI_AGENT_SETUP_GUIDE.md:13-18` **Vulnerability Type**: Hardcoded plaintext credentials **Risk Level**: High ### Vulnerable Code `config.json:2-5`: ```json { "apiKey": "bg_73063f99df20ccf3320032e80d0bd1f3", "secretKey": "ecdc70207a6395da7772210d1c6c8bf1a88f47af83b24dec2aa066d91f495387", "passphrase": "Lin12345", "isSimulation": false } ``` The same credential set is present in `multi_agent_config.json:6-11`: ```json "apiCredentials": { "apiKey": "bg_73063f99df20ccf3320032e80d0bd1f3", "secretKey": "ecdc70207a6395da7772210d1c6c8bf1a88f47af83b24dec2aa066d91f495387", "passphrase": "Lin12345", "isSimulation": false } ``` It is also disclosed in `MULTI_AGENT_SETUP_GUIDE.md:13-18`: ```json { "apiKey": "bg_73063f99df20ccf3320032e80d0bd1f3", "secretKey": "ecdc70207a6395da7772210d1c6c8bf1a88f47af83b24dec2aa066d91f495387", "passphrase": "Lin12345", "isSimulation": false } ``` ### Technical Analysis The project stores a valid-format Bitget API key, HMAC signing secret, and API passphrase directly in distributable configuration and documentation files. Numerous scripts read these values and use them to create authenticated Bitget API requests. The configuration explicitly sets `isSimulation` to `false`, indicating intended use against a real account rather than a sandbox. The Skill documentation recommends Spot Read and Spot Trade permissions, although the actual server-side permissions of the exposed key cannot be verified through static analysis. Possession of all three values is sufficient to construct authenticated requests if the credential remains active. Keeping multiple copies also increases the chance that incomplete remediation will leave a usable credential in documentation, archives, or repository history. No evidence was found that the project transmits these credentials to a destination other than Bitg ...[truncated 1468 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Immediately revoke the exposed Bitget API credential and create a new credential. Treat rotation as mandatory because removing the values from the current files does not invalidate previously copied versions. 2. Remove every credential copy from: - `config.json` - `multi_agent_config.json` - `MULTI_AGENT_SETUP_GUIDE.md` - Repository history, release archives, logs, backups, and generated reports. 3. Replace committed configuration with a placeholder template such as `config.example.json`. 4. Add real credential files to `.gitignore`. 5. Load secrets from environment variables or a protected operating-system secret store. 6. Validate that secret files have restrictive permissions, such as mode `0600` on Unix-like systems. 7. Default all example and newly generated configurations to simulation mode. 8. Restrict the replacement key to only the endpoints strictly required by the selected operation. Use separate read-only and trade-enabled credentials where practical. 9. Ensure withdrawal permissions remain disabled. 10. Configure a Bitget IP allowlist and rotate credentials whenever the approved host changes. 11. Add automated secret scanning to pre-commit hooks and continuous integration. 12. Avoid printing complete or partial API identifiers unless required for troubleshooting. ]]>

T06 · System Persistence

Error
Location
setup-cron.js:8
Finding
Enabled cross-session OpenClaw scheduled task with incomplete removal support<![CDATA[ ## Vulnerability Details **File Location**: `setup-cron.js:8-49` and `setup-cron.js:66-72` **Vulnerability Type**: Persistent scheduled task registration **Risk Level**: High ### Vulnerable Code `setup-cron.js:8-19` defines an enabled task that targets the main Agent session: ```javascript const DATA_DIR = __dirname; const CRON_CONFIG = { name: 'Bitget Grid Monitor', schedule: { kind: 'every', everyMs: 5 * 60 * 1000 // 5 minutes }, payload: { kind: 'systemEvent', text: '🟦 Bitget grid monitoring reminder: check grid status and order execution' }, sessionTarget: 'main', enabled: true }; ``` `setup-cron.js:26-49` checks for existing jobs and registers the persistent task: ```javascript function setupCron() { console.log('Setting up Bitget grid scheduled monitoring...\n'); try { const listOutput = execSync('openclaw cron list', { encoding: 'utf8' }); if (listOutput.includes('Bitget')) { console.log('A Bitget scheduled task already exists\n'); } } catch (e) { console.log('Unable to check existing scheduled tasks\n'); } const cronJson = JSON.stringify(CRON_CONFIG, null, 2); console.log('Cron configuration:\n'); console.log(cronJson); console.log('\n'); try { console.log('Adding a scheduled task: monitor every five minutes\n'); execSync(`openclaw cron add '${cronJson}'`, { stdio: 'inherit', cwd: DATA_DIR }); console.log('\nScheduled task configured successfully\n'); } catch (error) { console.error('Setup failed:', error.message); console.log('\nRun the following command manually:\n'); console.log(`openclaw cron add '${cronJson}'\n`); } } ``` `setup-cron.js:66-72` exposes a removal command that only prints instructions and does not remove the installed task: ```javascript function removeCron() { console.log('Removing Bi ...[truncated 3176 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not register scheduled tasks as part of ordinary startup or trading workflows. 2. Require explicit, separate confirmation that clearly states: - The task persists after the script exits. - Its execution interval. - Its session target. - How to inspect and remove it. 3. Default newly created tasks to disabled and require a second action to enable them. 4. Prefer an isolated session instead of `sessionTarget: 'main'`. 5. Capture and securely store the exact task ID returned by `openclaw cron add`. 6. Implement `removeCron()` so it invokes `openclaw cron remove` for the stored ID and verifies deletion. 7. Abort setup if an exact matching task already exists. 8. Use a stable unique identifier rather than checking whether the task list contains the broad term `Bitget`. 9. Add `status` output that reports the exact task ID, enabled state, interval, payload, and session target. 10. Provide a nonpersistent monitoring alternative that operates only while the invoking process remains active. 11. Add automated tests verifying that installation is opt-in, duplicate-safe, and fully reversible. 12. Document that `setup-cron-monitor.js` only writes configuration and instructions, while `setup-cron.js` performs actual OpenClaw task registration, so users can distinguish advisory setup from persistence installation. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (304)

Missing User Warnings

Critical
Confidence
100% confidence
Finding
This is a direct disclosure of operational exchange credentials without redaction or access control. Because the file documents a ready-to-run trading automation environment with cron jobs and controller scripts, the exposed secrets materially increase the risk of immediate account compromise, unauthorized trades, data exfiltration, and potential financial loss.

Context-Inappropriate Capability

Critical
Confidence
99% confidence
Finding
This code performs authenticated POST requests to Bitget's order-placement endpoint and can submit real buy orders in a loop. Because the script defaults to simulation unless an environment variable says otherwise but still supports live credentials and does not require runtime confirmation, misuse could trigger unauthorized market activity and financial loss.

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The guide contains what appear to be live Bitget API credentials, including an API key, secret key, and passphrase, embedded directly in documentation. In the context of an automated trading multi-agent setup, these secrets could allow unauthorized access to trading functions, account data, or fund movement depending on exchange permissions, making the exposure especially dangerous.

Missing User Warnings

High
Confidence
98% confidence
Finding
The sample `config.json` sets `isSimulation: false`, which normalizes live trading as the default example. Because this file also contains ready-to-run start commands, users may copy the config verbatim and execute real trades without appreciating that actual funds are at risk.

Ae1

High
Category
analysis-evasion
Content
| `start-simple.js` | Start all grids |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `check-balance.js` | Check account balance |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `grid-optimizer.js` | Optimize grid parameters |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `kline-analyzer.js` | Analyze K-line data |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `trade-analyzer.js` | Analyze trade history |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `quick-report.js` | Generate quick report |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `dynamic-adjust.js` | Dynamic grid adjustment |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `dynamic-rebalance.js` | Portfolio rebalancing |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `apply-scheme-a.js` | Apply optimization scheme A |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `start-eth.js` | Start ETH grid |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `deploy-bnb-grid.js` | Deploy BNB grid |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
| `buy-eth-market.js` | Buy ETH at market price |
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Missing User Warnings

High
Confidence
97% confidence
Finding
This script immediately cancels existing pending orders and places new live orders based on local configuration, with no dry-run mode, interactive confirmation, allowlist check, or explicit execution safeguard. In a trading automation context, that is dangerous because accidental invocation, bad config data, or tampered adjustment files can directly modify market positions and disrupt active strategies, causing financial loss.

Missing User Warnings

High
Confidence
98% confidence
Finding
This script performs destructive and financially sensitive actions against a live exchange account: it cancels all existing orders for each symbol and then places many new orders, all without any interactive confirmation, dry-run mode, environment guard, or explicit warning at execution time. In the context of an automated trading skill, this is especially dangerous because a mistaken run, wrong config, stale strategy parameters, or compromised invocation can immediately alter live positions and cause direct financial loss.

Missing User Warnings

High
Confidence
98% confidence
Finding
The script immediately cancels existing orders and places new live orders against an exchange API without any interactive confirmation, dry-run mode, or safety gate. In a trading automation skill, that creates a high-risk footgun: accidental execution, misconfiguration, or unauthorized invocation can directly cause destructive account changes and financial loss.

Missing User Warnings

High
Confidence
97% confidence
Finding
The script performs live bulk cancellation and redeployment of exchange orders immediately when executed, with no confirmation prompt, dry-run mode, account/environment validation, or trading safeguard. In the context of an agent skill, this is dangerous because accidental or automated execution can directly alter a user's real market positions and open orders, causing financial loss or unintended market exposure.

Missing User Warnings

High
Confidence
89% confidence
Finding
The CLI exposes commands such as `stop`/`cancel` (cancel all orders) and `buy-eth`/`buy-bnb` (market buys), then executes the mapped scripts directly via `execSync`. The file shows no confirmation prompt or explicit warning that these commands may place trades or cancel orders, which are safety-critical and potentially irreversible operations.

Missing User Warnings

High
Confidence
99% confidence
Finding
This code submits a real authenticated buy order to the exchange with no interactive confirmation, no dry-run default, and no visible safety prompt to the user. In the context of an agent skill, that is especially dangerous because execution can directly cause financial loss or unauthorized trading if the script is triggered unintentionally or with the wrong account configuration.

Missing User Warnings

High
Confidence
98% confidence
Finding
The script places live market buy orders automatically as soon as it runs, with no user confirmation, dry-run mode, or final review step. In a trading context this is dangerous because accidental execution, misuse, or invocation in the wrong environment can immediately spend funds and create irreversible financial exposure.

Missing User Warnings

High
Confidence
98% confidence
Finding
This script places a real market buy order against a live exchange using configured API credentials with no interactive confirmation, dry-run mode, environment gating, or other execution safeguard. In the context of an agent skill, this is dangerous because accidental invocation, misuse by another component, or misunderstanding by the operator can immediately spend funds and create unwanted positions.

Missing User Warnings

High
Confidence
97% confidence
Finding
This script immediately cancels all open BTCUSDT spot orders as soon as it is run, with no confirmation prompt, dry-run mode, order count threshold, or account/environment safety check. In a trading automation context this is a destructive financial action that can cause unintended strategy disruption, lost execution opportunities, and accidental cancellation on a live account if environment variables are misconfigured.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access, suspicious.exposed_secret_literal (+1 more)

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
bitget-cli.js:89

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
quick-start.js:112

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
setup-cron.js:28

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
cancel-all-orders.js:10

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
check-balance.js:10

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
start-avax-matic.js:10

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
start-btc-grid.js:10

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
start-eth-xrp.js:10

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
start-eth.js:9

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
start-grids.js:11

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
start-simple.js:11

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
start-sol.js:10

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
test-api-debug.js:10

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
analyze-coins.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
apply-scheme-a-final.js:16

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
cancel-all-btc.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
cancel-all.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
check-prices.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
debug-orders.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
optimize-strategy.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
rebalance.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
stop-btc-grid.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
test-eth-grid.js:14

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
use-sdk.js:17

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
analyze-strategy.js:66

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
cancel-all-orders.js:73

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
check-balance.js:65

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
optimize-grids.js:73

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
start-eth-xrp.js:71

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
start-grids.js:78

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
test-grid-api.js:65