Back to skill

Security audit

Binance Web3

Security checks for vulnerabilities and agentic risk

Overview

This skill queries Web3 market endpoints with small shell scripts; it has documentation and validation gaps, but no evidence of credential theft, persistence, or destructive behavior.

Install only if you are comfortable with the skill sending token symbols, contract addresses, chain IDs, and any wallet addresses you provide to Binance Web3 or the K-line API host. Treat results as unauthenticated third-party API data, avoid supplying sensitive user-associated wallet addresses without intent, and prefer adding input validation and clearer documentation before broad use.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
.
Finding
Unescaped User Input in JSON Request Bodies<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/address-info.sh:7-10` - `scripts/token-audit.sh:7-10` - `scripts/trading-signal.sh:5-9` - `scripts/market-rank.sh:35-40` **Vulnerability Type**: Improper construction of JSON using untrusted input **Risk Level**: Medium ### Vulnerable Code `scripts/address-info.sh:7-10` ```bash curl -s "https://web3.binance.com/bapi/defi/v1/wallet-direct/buw/wallet/token/balance" \ -H "Content-Type: application/json" \ -H "Accept-Encoding: identity" \ -d "{\"address\":\"$ADDRESS\",\"chainId\":\"$CHAIN\"}" | jq '.' ``` `scripts/token-audit.sh:7-10` ```bash curl -s "https://web3.binance.com/bapi/defi/v1/wallet-direct/buw/wallet/governance/token/info" \ -H "Content-Type: application/json" \ -H "Accept-Encoding: identity" \ -d "{\"symbol\":\"$SYMBOL\",\"chainId\":\"$CHAIN\"}" | jq '.' ``` `scripts/trading-signal.sh:5-9` ```bash curl -s "https://web3.binance.com/bapi/defi/v1/public/wallet-direct/buw/wallet/web/signal/smart-money" \ -H "Content-Type: application/json" \ -H "Accept-Encoding: identity" \ -d "{\"smartSignalType\":\"\",\"page\":1,\"pageSize\":20,\"chainId\":\"${CHAINID}\"}" | jq '.' ``` `scripts/market-rank.sh:35-40` ```bash curl -s -x "$PROXY" \ "https://web3.binance.com/bapi/defi/v1/public/wallet-direct/buw/wallet/web/signal/smart-money" \ -H "Accept-Encoding: identity" \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d "{\"smartSignalType\":\"\",\"page\":1,\"pageSize\":15,\"chainId\":\"$CHAIN\"}" | jq '.data[]? | {token: .ticker, chain: .chainId, platform: .launchPlatform} ' 2>/dev/null ``` ### Technical Analysis Caller-controlled values are interpolated directly into JSON text without JSON escaping or input-format validation. Inputs containing quotation marks, commas, braces, or duplicate property names can terminate the intended string value and alter the structure of the request body. The values are enclosed in shell quotes, so this ...[truncated 1133 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Construct request bodies with a JSON-aware utility instead of string interpolation: ```bash jq -n \ --arg address "$ADDRESS" \ --arg chainId "$CHAIN" \ '{address: $address, chainId: $chainId}' | curl -s "https://web3.binance.com/..." \ -H "Content-Type: application/json" \ -H "Accept-Encoding: identity" \ --data-binary @- ``` - Validate chain IDs against the documented allowlist, such as `56`, `8453`, `1`, and `CT_501`. - Validate EVM addresses with a strict hexadecimal-address pattern and apply chain-specific validation for non-EVM addresses. - Restrict token symbols to an explicitly supported character set and reasonable length. - Add argument-presence checks and terminate with a nonzero status when validation fails. - Use `curl --fail-with-body --show-error` and handle non-success responses explicitly. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
.
Finding
Unencoded User Input in URL Query Strings<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/meme-rush.sh:6-7` - `scripts/token-dynamic.sh:7-8` - `scripts/token-kline.sh:8-9` - `scripts/token-search.sh:6-7` **Vulnerability Type**: Query-parameter injection through improper URL construction **Risk Level**: Low ### Vulnerable Code `scripts/meme-rush.sh:6-7` ```bash curl -s "https://web3.binance.com/bapi/defi/v1/wallet-direct/buw/wallet/market/hot?chainId=$CHAIN" \ -H "Accept-Encoding: identity" | jq '.' ``` `scripts/token-dynamic.sh:7-8` ```bash curl -s "https://web3.binance.com/bapi/defi/v4/public/wallet-direct/buw/wallet/market/token/dynamic/info?chainId=${CHAINID}&contractAddress=${CONTRACT}" \ -H "Accept-Encoding: identity" | jq '.' ``` `scripts/token-kline.sh:8-9` ```bash curl -s "https://dquery.sintral.io/u-kline/v1/k-line/candles?address=${ADDRESS}&platform=${PLATFORM}&interval=${INTERVAL}&limit=${LIMIT}" \ -H "Accept-Encoding: identity" | jq '.' ``` `scripts/token-search.sh:6-7` ```bash curl -s "https://web3.binance.com/bapi/defi/v5/public/wallet-direct/buw/wallet/market/token/search?keyword=${KEYWORD}&chainIds=${CHAINIDS}&orderBy=volume24h" \ -H "Accept-Encoding: identity" | jq '.' ``` ### Technical Analysis The scripts concatenate caller-controlled values directly into URL query strings. Characters such as `&`, `=`, and `#`, or their encoded representations, may alter parameter boundaries, add duplicate parameters, or truncate portions of the query. Because the complete URL is enclosed in shell quotes, the issue does not provide shell-command injection. HTTPS also fixes the request destination to the hardcoded host, so the finding does not establish arbitrary-server SSRF. The affected security boundary is the set of query parameters submitted to the intended API. ### Attack Path 1. An attacker provides a crafted keyword, address, chain, platform, interval, or limit value containing query delimiters. 2. The value is passed to an affected script. 3. The script conca ...[truncated 657 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Use `curl --get` with `--data-urlencode` for every query parameter: ```bash curl -s --get \ "https://web3.binance.com/bapi/defi/v5/public/wallet-direct/buw/wallet/market/token/search" \ --data-urlencode "keyword=$KEYWORD" \ --data-urlencode "chainIds=$CHAINIDS" \ --data-urlencode "orderBy=volume24h" \ -H "Accept-Encoding: identity" ``` - Enforce allowlists for chain IDs, platforms, and candlestick intervals. - Require numeric limits to contain digits only and enforce a conservative maximum. - Apply strict chain-specific validation to contract and wallet addresses. - Restrict search-keyword length to prevent excessive or malformed requests. - Add `--fail-with-body --show-error` and explicit timeout and response-size controls. ]]>

other

Note
Location
scripts/address-info.sh:2
Finding
Undocumented Disclosure of User Wallet Addresses to a Remote Service<![CDATA[ ## Vulnerability Details **File Location**: `scripts/address-info.sh:2-10` **Vulnerability Type**: Privacy exposure through undisclosed remote data transmission **Risk Level**: Low ### Vulnerable Code ```bash # Query Address Info - 地址持仓洞察 # Usage: ./address-info.sh <address> [chainId] ADDRESS="${1}" CHAIN="${2:-56}" curl -s "https://web3.binance.com/bapi/defi/v1/wallet-direct/buw/wallet/token/balance" \ -H "Content-Type: application/json" \ -H "Accept-Encoding: identity" \ -d "{\"address\":\"$ADDRESS\",\"chainId\":\"$CHAIN\"}" | jq '.' ``` ### Technical Analysis The script transmits a user-provided blockchain address and chain identifier to Binance Web3. The project documentation describes token search, dynamic token data, K-line charts, and smart-money signals, but does not document the included wallet-address balance lookup or clearly disclose that wallet addresses are sent to a third party. Blockchain addresses are public identifiers, but associating an address with a particular request source, IP address, timestamp, or usage pattern may still reveal sensitive behavioral information. The script does not read local wallet files, private keys, seed phrases, or authentication tokens. ### Attack Path 1. A user supplies a wallet address for analysis, or an agent selects the included helper script. 2. The script places the wallet address and chain identifier into an HTTPS request body. 3. The request is transmitted to Binance Web3. 4. The remote service can observe the submitted wallet address together with normal request metadata. 5. Repeated requests may allow the service to correlate wallet interests or activity with the request origin. ### Impact Assessment The impact is limited to privacy and metadata exposure. The remote service receives a public blockchain address and chain identifier and may associate them with network metadata. The code does not grant access to wallet funds, private keys, local files, elevated privileges, or pers ...[truncated 24 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Document the wallet-balance capability in `SKILL.md`. - Clearly state that wallet addresses and chain identifiers are transmitted to Binance Web3. - Require explicit user confirmation before sending a user-associated wallet address to a remote service. - Do not invoke this script for ordinary token-search or market-data requests. - Minimize request logging where operationally possible and document the remote provider's privacy implications. - Validate addresses locally before transmission to avoid unnecessary disclosure of malformed or unrelated input. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared description focuses on market-oriented data such as token prices, market data, charting, and smart money signals. The supplied code does not query any of those; instead, it performs an address-specific wallet balance lookup using a wallet/token/balance endpoint. That is a materially different primary capability: address portfolio inspection rather than market analytics. Although it uses Binance Web3 APIs and a supported chain ID, the actual function is undeclared and not reasonably implied by the stated description.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The description significantly overstates the implemented functionality. The supplied code only performs one concrete action: querying Binance Web3 smart money signals and formatting a subset of the response. It does not implement token search, token price lookup, market data retrieval, or K-line chart access. The declared chain coverage also mentions Base and Solana, but the script documentation and examples only identify BSC and Ethereum, with no evidence of explicit support for Base or Solana in this chunk. While using Binance Web3 APIs is consistent, the actual primary purpose is much narrower than described, so this is a material description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
The declared description focuses on price lookup, market data, charting, and smart money trading signals. However, the actual code only performs a token info/audit-style lookup against a governance token information endpoint. That is a materially different primary purpose from the described market and trading analytics functionality. While both concern tokens and Binance Web3 APIs, this code chunk does not demonstrate the declared capabilities and instead exposes an undeclared token audit/info retrieval capability.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill advertises executable shell scripts in SKILL.md but does not declare any tool scope such as permissions or allowed-tools. This creates an execution-surface ambiguity where an agent may invoke shell capabilities without explicit least-privilege constraints, increasing the risk of unintended command execution or overly broad runtime access.

External Transmission

Medium
Category
Data Exfiltration
Content
ADDRESS="${1}"
CHAIN="${2:-56}"

curl -s "https://web3.binance.com/bapi/defi/v1/wallet-direct/buw/wallet/token/balance" \
  -H "Content-Type: application/json" \
  -H "Accept-Encoding: identity" \
  -d "{\"address\":\"$ADDRESS\",\"chainId\":\"$CHAIN\"}" | jq '.'
Confidence
70% 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 script silently defaults to routing traffic through a proxy via HTTP_PROXY or a hardcoded local proxy without any user warning or consent. In a security-sensitive skill, proxy-mediated transmission can expose request metadata and API payloads to an intermediary, and the risk is elevated because the proxy is applied automatically rather than being an explicit opt-in behavior.

External Transmission

Medium
Category
Data Exfiltration
Content
case "$TYPE" in
    smart-money)
        curl -s -x "$PROXY" \
            "https://web3.binance.com/bapi/defi/v1/public/wallet-direct/buw/wallet/web/signal/smart-money" \
            -H "Accept-Encoding: identity" \
            -H "Content-Type: application/json" \
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
SYMBOL="${1}"
CHAIN="${2:-56}"

curl -s "https://web3.binance.com/bapi/defi/v1/wallet-direct/buw/wallet/governance/token/info" \
  -H "Content-Type: application/json" \
  -H "Accept-Encoding: identity" \
  -d "{\"symbol\":\"$SYMBOL\",\"chainId\":\"$CHAIN\"}" | jq '.'
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
CHAINID="${1:-56}"

curl -s "https://web3.binance.com/bapi/defi/v1/public/wallet-direct/buw/wallet/web/signal/smart-money" \
  -H "Content-Type: application/json" \
  -H "Accept-Encoding: identity" \
  -d "{\"smartSignalType\":\"\",\"page\":1,\"pageSize\":20,\"chainId\":\"${CHAINID}\"}" | jq '.'
Confidence
70% 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

Low
Confidence
95% confidence
Finding
This shell script performs an HTTP request to an external Binance endpoint and transmits the provided wallet address and chain ID, but the file contains no warning, confirmation, or user-facing notice about that disclosure. For code files, outbound network transmission of user data should have at least some visible disclosure unless clearly documented as part of the skill's stated purpose; the current comments only show usage, not the privacy-impacting behavior.

Missing User Warnings

Low
Confidence
87% confidence
Finding
The script performs an external HTTP request using curl and sends the chain ID and contract address to a remote Binance endpoint. There is no confirmation prompt, user-facing notice, or explanatory comment warning that input values will be transmitted over the network.

Static analysis

No suspicious patterns detected.