Back to skill

Security audit

Binance Spot Trader

Security checks for vulnerabilities and agentic risk

Overview

This skill is a live Binance trading bot whose documented safety limits are incomplete or unenforced, so it needs careful review before use with real funds.

Treat this as a Review item, not a routine install. Use only Binance API keys with withdrawals disabled, IP restrictions, and limited funds. Do not run the cron example or live trading until you have verified or added real dry-run mode, confirmation gates, position caps, DCA scheduling, exchange filter validation, and stop-loss/take-profit behavior.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/trader.py:137
Finding

Documented Position, Take-Profit, and Stop-Loss Controls Are Not Enforced

Content
View full analysis
= 10: # Binance minimum place_order(symbol, "BUY", qty) else: log.info(f" Skip: trade size ${trade_usdt:.2f} below $10 minimum") elif signal == " ...[truncated 2386 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/trader.py:148
Finding

DCA Interval Is Ignored, Allowing Purchases on Every Invocation

Content
View full analysis
> trader.log 2>&1 ``` The documented `DCA_INTERVAL` setting is never read or enforced by `trader.py`. ### Technical Analysis DCA mode unconditionally produces a `BUY` signal every time the program runs. There is no persisted timestamp, scheduler state, locking mechanism, idempotency key, or check for the last successful DCA transaction. Consequently, the documented five-minute cron example is incompatible with the documented hourly, daily, or weekly DCA behavior. For example, a nominally daily DCA strategy can attempt up to 288 purchases per day if the generic cron example is used. Process overlap can compound this issue because there is also no lock preventing concurrent executions from independently submitting orders. ### Attack Path 1. The operator sets `STRATEGY=dca`, `DCA_INTERVAL=daily`, and a positive `DCA_AMOUNT_USDT`. 2. The operator follows the documented cron example, which invokes the program every five minutes. 3. Each process enters the DCA branch and assigns `signal = "BUY"`. 4. No code checks `DCA_INTERVAL` or the timestamp of the previous purchase. 5. Each invocation with sufficient balance submits another market buy. 6. Repeated invocations continue until orders fail or available funds are depleted. An attacker who can trigger repeated legitimate invocations could produce the same result, but no attacker-controlled code execution or privilege escalation is ...[truncated 419 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/trader.py:160
Finding

Unvalidated Configuration Values Flow into Market-Order Quantities

Content
View full analysis
= 10: # Binance minimum place_order(symbol, "BUY", qty) else: log.info(f" Skip: trade size ${trade_usdt:.2f} below $10 minimum") ``` Order quantities are then formatted using a fixed precision: ```python params = { "symbol": symbol, "side": side, "type": "MARKET", "quantity": f"{quantity:.6f}" } ``` ### Technical Analysis The bot converts environment values directly to numeric types but does not apply semantic constraints. It does not verify that: - `TRADE_SIZE_PCT` is positive and at most an approved percentage. - `DCA_AMOUNT_USDT` is positive and no greater than available funds or an exposure cap. - The calculated quantity is finite and positive. - A symbol is approved and has the expected quote asset. - Quantity precision complies with the symbol's Binance `LOT_SIZE` filter. - The order complies with `MIN_NOTIONAL`, `MARKET_LOT_SIZE`, or other current exchange filters. The comment that Binance has a universal $10 minimum is not a safe substitute for querying `/api/v3/exchangeInfo`. Fixed six-decimal formatting can round quantities incorrectly for symbols with different step sizes. ### Attack Path 1. An operator or another process capable of modifying the environment supplies an excessive `TRADE_SIZE_PCT` or `D ...[truncated 1128 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
scripts/setup.sh:4
Finding

Installer Fetches and Installs PyPI Artifacts Without Integrity Verification

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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared behavior understates or misstates materially risky functionality: the skill places live exchange orders while lacking clear permission declarations, and it claims risk controls and portfolio management features that static analysis indicates are not actually enforced. In a financial trading skill, this mismatch is especially dangerous because users may rely on nonexistent stop-loss, take-profit, or position-limit protections and suffer direct monetary loss from autonomous execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The markdown describes an autonomous trader and cron execution, but it does not prominently and early warn that using the skill can place real exchange orders on a recurring schedule with real funds. In a financial context, insufficient warning is dangerous because users may treat setup/run steps as informational or simulated and unknowingly enable unattended live trading.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/setup.sh (reported line 5)May include surrounding context.

sh
set -e
echo "=== Binance Spot Trader Setup ==="
pip install httpx==0.27.0 python-dotenv==1.0.1
echo "Done. Create .env with BINANCE_API_KEY, BINANCE_SECRET_KEY, and LLM_API_KEY"

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The bot can place live MARKET buy and sell orders directly against a real Binance account based solely on programmatic signals, with no explicit user confirmation, dry-run default, or safety interlock. In a trading automation skill, this is especially dangerous because mistakes, prompt-driven misuse, bad configuration, or logic errors can immediately convert into irreversible financial loss.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises and instructs use of environment secrets, file creation/logging, and network access to Binance and an LLM provider, but does not declare explicit tool scope or permissions. In an autonomous trading context, missing scope declarations materially increases the risk of unintended live trading, secret exposure, or other side effects because users and runtime policy cannot clearly constrain what the skill may do.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The activation language is broad enough to trigger on general requests about trading, automation, DCA, or building a bot, which can cause the skill to be invoked in contexts where the user did not intend live order execution. Because this skill can autonomously trade on a real exchange, overly loose matching raises the chance of high-risk actions being surfaced or run without sufficiently specific user intent.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
- Start with tiny amounts ($50-100) and paper trade first
- Monitor actively during first 24 hours
- Set up Binance email alerts for all trades
- **API keys on disk** — secure your server (SSH keys only, firewall, chmod 600)

## References

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code accesses sensitive credentials via BINANCE_API_KEY and BINANCE_SECRET_KEY and sends an authenticated request to retrieve account data from Binance. There is no confirmation prompt, user-facing warning, or explanatory comment/docstring disclosing that private account information will be accessed over the network.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script sends trading-derived data such as symbol, recent closes, volume trend, and RSI to a third-party API when USE_LLM is enabled. This is a network transmission of user/system-derived trading data, but the file provides no user-facing warning, prompt, or explanatory comment disclosing that market context from the user's trading workflow is shared externally.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The script transmits trading context to a third-party LLM endpoint, creating an external data flow outside Binance and the local system. In an autonomous trading bot, this increases exposure of proprietary strategy inputs and can create privacy, compliance, and operational risk if users are not informed or if future prompt changes include sensitive account details.

Content

Scanner excerpt · scripts/trader.py (reported line 86)May include surrounding context.

python
Reply ONLY a number."""

    with httpx.Client(timeout=30) as c:
        resp = c.post("https://api.anthropic.com/v1/messages",
            headers={"x-api-key": LLM_API_KEY, "anthropic-version": "2023-06-01", "Content-Type": "application/json"},
            json={"model": "claude-3-5-haiku-20241022", "max_tokens": 20, "messages": [{"role": "user", "content": prompt}]})
        text = resp.json().get("content", [{}])[0].get("text", "0.5").strip()

Static analysis

No suspicious patterns detected.