Back to skill

Security audit

Binance Fiat

Security checks for vulnerabilities and agentic risk

Overview

The skill is for Binance fiat API access, but it overreaches by searching broad secret files and persisting exchange credentials in plaintext.

Review before installing. Use only narrowly scoped Binance API keys, disable withdrawals unless required, prefer IP allowlisting, and do not let the skill store keys in TOOLS.md or read generic .env files containing unrelated secrets.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:86
Finding

Overbroad Discovery and Use of Credentials from General-Purpose Environment Files

Content
View full analysis
/dev/null | cut -d= -f2-) SECRET_KEY=$(grep '^BINANCE_SECRET_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-) # Fallback: search .env in known directories (KEY=VALUE then raw line format) for dir in ~/.openclaw ~; do [ -n "$API_KEY" ] && break env_file="$dir/.env" [ -f "$env_file" ] || continue # Read first two lines line1=$(sed -n '1p' "$env_file") line2=$(sed -n '2p' "$env_file") # Check if lines contain '=' indicating KEY=VALUE format if [[ "$line1" == *=* && "$line2" == *=* ]]; then API_KEY=$(grep '^BINANCE_API_KEY=' "$env_file" 2>/dev/null | cut -d= -f2-) SECRET_KEY=$(grep '^BINANCE_SECRET_KEY=' "$env_file" 2>/dev/null | cut -d= -f2-) else # Treat lines as raw values API_KEY="$line1" SECRET_KEY="$line2" fi done ``` ### Technical Analysis Accessing the explicitly named `BINANCE_API_KEY` and `BINANCE_SECRET_KEY` variables is necessary for authenticated Binance requests. However, the fallback logic reads the first two lines of general-purpose files such as `~/.env` and treats them as Binance credentials when both lines do not contain an equals sign. A user's home-level `.env` file is not necessarily dedicated to this Skill. Its first two lines can contain unrelated passwords, access tokens, private keys, or other sensitive values. Reading arbitrary lines therefore exceeds the least privilege required by the declared Binance fiat functionality. The Skill also states that the first credential-discovery methods may be used automatically. Consequently, unrelated secrets can be accessed without the user explicitly selecting or approving the particular file. ### Attack Path 1. A user has a general-purpose `~/.env` fil ...[truncated 1317 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:190
Finding

Plaintext Persistence of Binance API Credentials in TOOLS.md

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (13)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

The skill explicitly instructs the agent to access local secret files such as ~/.openclaw/secrets.env to obtain API credentials. This is dangerous because it normalizes local credential harvesting behavior in a skill whose primary purpose is API interaction, increasing the risk of unauthorized secret access and lateral exposure.

Content

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

  1. Secrets file (.env)

Check ~/.openclaw/secrets.env , ~/.env, or a .env file in the workspace. Read individual keys with grep, never source the full file:

bash
# Try all credential locations in order
API_KEY=$(grep '^BINANCE_API_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This finding reflects continued guidance to pull both API key and secret from a local secrets.env file. Reading sensitive credentials from local storage inside the skill broadens trust boundaries and can be abused to collect or reuse secrets without clear, per-action authorization.

Content

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

Check ~/.openclaw/secrets.env , ~/.env, or a .env file in the workspace. Read individual keys with grep, never source the full file:

bash
# Try all credential locations in order
API_KEY=$(grep '^BINANCE_API_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)
SECRET_KEY=$(grep '^BINANCE_SECRET_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)

# Fallback: search .env in known directories (KEY=VALUE then raw line format)

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The skill further expands credential discovery by iterating through local directories to find potential secret files, which constitutes generalized secret searching behavior. In an agent environment, such search patterns are risky because they encourage broader filesystem inspection than is necessary for a fiat API request.

Content

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

bash
# Try all credential locations in order
API_KEY=$(grep '^BINANCE_API_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)
SECRET_KEY=$(grep '^BINANCE_SECRET_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)

# Fallback: search .env in known directories (KEY=VALUE then raw line format)
for dir in ~/.openclaw ~; do

Credential Access

High
Category
Privilege Escalation
Confidence
94% confidence
Finding

The instruction to inspect .env files in user directories for Binance credentials exposes a common repository and workspace secret location to automated access. Since .env files often contain unrelated sensitive values, this behavior increases the chance of over-collection and accidental exposure beyond the intended API keys.

Content

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

md
API_KEY=$(grep '^BINANCE_API_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)
SECRET_KEY=$(grep '^BINANCE_SECRET_KEY=' ~/.openclaw/secrets.env 2>/dev/null | cut -d= -f2-)

# Fallback: search .env in known directories (KEY=VALUE then raw line format)
for dir in ~/.openclaw ~; do
  [ -n "$API_KEY" ] && break
  env_file="$dir/.env"

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

Reading the first lines of a discovered .env file and treating them as raw credentials is especially unsafe because it can misparse arbitrary secrets and encourages non-specific extraction from sensitive files. This can lead to accidental ingestion of unrelated secrets or use of malformed credentials in security-critical financial operations.

Content

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

md
# Fallback: search .env in known directories (KEY=VALUE then raw line format)
for dir in ~/.openclaw ~; do
  [ -n "$API_KEY" ] && break
  env_file="$dir/.env"
  [ -f "$env_file" ] || continue

  # Read first two lines

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill tells the agent to store user-provided Binance API credentials in TOOLS.md, creating unnecessary local persistence of sensitive secrets. Persisting exchange API keys to disk in a general documentation file greatly increases exposure through accidental disclosure, version control commits, or access by other tools and users.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The instructions direct the agent to write newly provided API credentials into TOOLS.md without adequate safeguards, effectively encouraging plaintext secret persistence on disk. This can expose Binance keys to local compromise, backups, logs, repository commits, or later unintended disclosure by the agent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructs the agent to proactively retrieve API credentials from local environment variables and secret files, expanding its capability from making fiat API calls to harvesting locally stored secrets. In an agent setting, this broad credential-access behavior increases the chance of unauthorized secret collection and misuse beyond the immediate user task.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The text at L134 says the location of the API key and secret file must never be disclosed, yet L86 explicitly lists concrete file paths such as ~/.openclaw/secrets.env and ~/.env. That is an active contradiction within the skill documentation about whether secret file locations should be revealed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

Defaulting to the 'main' account when account choice is ambiguous can cause authenticated actions to run against the wrong Binance account. In a financial context, mistaken account selection can lead to unintended data disclosure or execution of deposits/withdrawals using higher-value credentials.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation explicitly says implementations must detect the key type before signing, but the concrete example hard-codes HMAC signing as the active path. This can mislead integrators into using the wrong signing method for RSA or Ed25519 keys, causing authentication failures and potentially unsafe ad hoc workarounds around signing and key handling.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · references/authentication.md (reported line 87)May include surrounding context.

Request:

bash
curl -X GET "https://api.binance.com/sapi/v1/fiat/orders" \
  -H "X-MBX-APIKEY: your_api_key" \
  -H "User-Agent: binance-fiat/1.1.0 (Skill)" \
  -d "transactionType=...&timestamp=1234567890123&signature=..."

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 · references/authentication.md (reported line 87)May include surrounding context.

Request:

bash
curl -X GET "https://api.binance.com/sapi/v1/fiat/orders" \
  -H "X-MBX-APIKEY: your_api_key" \
  -H "User-Agent: binance-fiat/1.1.0 (Skill)" \
  -d "transactionType=...&timestamp=1234567890123&signature=..."

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
SKILL.md:180