Back to skill

Security audit

币安资金费率监控

Security checks for vulnerabilities and agentic risk

Overview

This paid Binance monitoring skill also ships an undisclosed, directly executable live futures trading strategy, so it needs review before installation.

Install only after treating this as a review-required financial tool, not a simple monitor. Use a dedicated Binance API key with withdrawals disabled and, unless you intentionally want automation, no futures-trading permission; restrict the key by IP where possible. Be aware that the package contains directly executable live futures trading code and that billing verification contacts SkillPay with session-linked metadata.

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

Error
Location
funding_arbitrage.py:197
Finding
Undocumented Live Leveraged Trading Capability in a Monitoring Skill<![CDATA[ ## Vulnerability Details **File Location**: `funding_arbitrage.py:197-230` and `funding_arbitrage.py:356-367` **Vulnerability Type**: Undeclared privileged financial operations **Risk Level**: High ### Vulnerable Code The implementation can change account leverage and submit live market orders: ```python self._request('POST', '/fapi/v1/leverage', { 'symbol': symbol, 'leverage': self.PARAMS['leverage'] }, signed=True) order_side = 'BUY' if side == 'LONG' else 'SELL' params = { 'symbol': symbol, 'side': order_side, 'type': 'MARKET', 'quantity': quantity, 'positionSide': 'BOTH' } result = self._request('POST', '/fapi/v1/order', params, signed=True) ``` Direct execution of the module activates the rebalancing strategy: ```python def main(): trader = FundingRateArbitrage() trader.rebalance() if __name__ == '__main__': main() ``` ### Technical Analysis The package documentation and MCP tool manifest describe account monitoring functions that read balances, positions, and funding income. However, `funding_arbitrage.py` also contains executable trading functionality that: 1. Selects futures symbols based on funding rates. 2. Sets futures leverage to 10×. 3. Submits signed market orders to open long and short positions. 4. Submits reduce-only market orders to close positions. 5. Automatically invokes the strategy when the module is executed directly. These operations require substantially greater privileges than a monitoring-only skill. A Binance API credential configured with futures trading permission can therefore be used to modify the account and expose funds to leveraged market risk. The normal MCP server code does not invoke `rebalance()` or the order methods. Exploitation consequently requires direct execution of `funding_arbitrage.py`, or another local component importing the class and invoking those methods. Nevertheless, the sensitive capability is shipped in the monitoring package and is directly ...[truncated 1499 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `open_position`, `close_position`, `rebalance`, and the direct strategy entry point from the monitoring package. 2. Separate monitoring and trading into independently distributed components with distinct names, manifests, and documentation. 3. Require users of the monitoring skill to create a Binance API key with read-only permissions and no futures trading or withdrawal privileges. 4. Add an explicit runtime check that rejects credentials or configurations intended for trading where the Binance API supports such validation. 5. If trading is an intended feature, require explicit opt-in configuration and interactive confirmation before every order. 6. Implement strict controls for maximum order value, aggregate exposure, leverage, supported symbols, and acceptable price deviation. 7. Add a dry-run mode enabled by default, with production trading requiring a clearly named setting such as `ENABLE_LIVE_TRADING=true`. 8. Update all documentation and manifests to disclose every account-modifying operation and the exact API permissions required. 9. Add automated tests verifying that the monitoring server cannot invoke any account-mutating Binance endpoint. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
server.py:28
Finding
Payment Authorization Fails Open When the SkillPay API Key Is Missing<![CDATA[ ## Vulnerability Details **File Location**: `server.py:28-31` **Vulnerability Type**: Fail-open authorization control **Risk Level**: Medium ### Vulnerable Code ```python async def verify_payment(session_id: str) -> bool: if not SKILLPAY_API_KEY or SKILLPAY_API_KEY == "YOUR_API_KEY_HERE": return True ``` ### Technical Analysis Payment verification is treated as an authorization gate for every exposed MCP tool. The verification function automatically returns `True` when `SKILLPAY_API_KEY` is absent or contains the placeholder value. This is a fail-open design: a missing production secret disables the security control rather than preventing service startup or denying requests. There is no separate development-mode flag, environment validation, caller authentication, or restriction that confines this bypass to a trusted local test environment. All four MCP handlers invoke `verify_payment()` before accessing Binance account information. Because the function succeeds without a valid SkillPay key, any caller that can communicate with the running MCP server can provide an arbitrary or empty session identifier and pass the payment check. ### Attack Path 1. The MCP server is started without `SKILLPAY_API_KEY`, or with `SKILLPAY_API_KEY=YOUR_API_KEY_HERE`. 2. An untrusted caller gains access to the server's MCP transport through the hosting agent or surrounding integration. 3. The caller invokes `get_account_summary`, `get_positions`, `get_funding_income`, or `get_full_report` with an arbitrary or empty `session_id`. 4. `verify_payment()` detects the missing or placeholder API key and returns `True`. 5. The requested tool creates a Binance client using the server's environment credentials. 6. The tool retrieves and returns sensitive account balances, margin usage, open positions, unrealized profit and loss, or funding-income information without successful payment verification. ### Impact Assessment A caller with access to the MCP server ca ...[truncated 576 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Fail closed when `SKILLPAY_API_KEY` is missing, empty, or still set to a placeholder. 2. Validate mandatory production configuration during startup and terminate the server if payment verification cannot be configured. 3. If a development bypass is necessary, require a separate explicit setting such as `SKILLPAY_DEVELOPMENT_MODE=true`. 4. Reject development mode when the service is not restricted to a trusted local environment. 5. Require a nonempty, well-formed session identifier before contacting the payment service. 6. Bind verified payments to the requested skill, tool, expected amount, currency, caller identity, and a single-use transaction or nonce. 7. Define request timeouts for payment verification and continue to deny access on timeout, malformed responses, or network errors. 8. Log failed and bypassed authorization attempts without recording API keys, Binance credentials, or other sensitive values. 9. Add tests confirming that missing, placeholder, malformed, expired, and invalid SkillPay credentials always result in denied tool access. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared purpose is passive monitoring, but the detected behavior includes placing trades, closing positions, setting leverage, and executing an arbitrage strategy using trading-capable signed requests. This is a severe trust-boundary violation: users may provide credentials expecting read-only monitoring while the skill can perform irreversible financial actions that may cause direct asset loss.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The skill metadata describes a monitoring tool, but the implementation performs authenticated futures trading by opening and closing real positions. This mismatch is dangerous because users may grant API credentials expecting read-only monitoring while the code can place market orders and materially affect account funds.

Missing User Warnings

High
Confidence
97% confidence
Finding
The rebalance flow can automatically open and close live futures positions without any user confirmation, approval checkpoint, or prominent warning. This is dangerous because a user invoking what appears to be a monitoring skill could trigger real leveraged trades and losses immediately, especially given the use of market orders.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README instructs users to export sensitive Binance API credentials but provides no warning about minimizing API permissions, avoiding withdrawal rights, secure local storage, or the possibility that the skill may access and transmit those secrets. In a paid third-party account-monitoring skill, this omission is security-relevant because users are being asked to trust a tool with high-value exchange credentials without adequate handling guidance.

External Transmission

Medium
Category
Data Exfiltration
Content
### 可选(SkillPay 配置,通常由平台自动注入)
```bash
export SKILLPAY_API_KEY="your_skillpay_api_key"
export SKILLPAY_ENDPOINT="https://api.skillpay.me/v1"
```

## 功能
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill declares access to sensitive Binance credentials and appears to require network and environment access, but it does not explicitly constrain or disclose its tool scope via permissions or allowed-tools. In a financial skill handling API secrets, missing scope boundaries increases the risk of overbroad execution, unexpected outbound requests, and misuse of credentials beyond the stated monitoring purpose.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill requests highly sensitive Binance API credentials but does not warn users about the risks of exposing trading-capable keys, recommended permission restrictions, storage handling, or how the secrets are used. In the context of a financial service, this omission materially increases the likelihood of credential misuse, overprivileged key submission, and unauthorized account actions.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The code loads Binance API credentials from environment variables and uses signed requests for account access and order placement, which exceeds the expectations of a simple monitoring utility. In the context of a misrepresented skill, this broad authenticated access increases the chance of unauthorized or surprising actions against a user's trading account.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Natural-language strings, docstrings, and user-facing responses throughout the file are written in Chinese, and there is no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking region. This creates a locale policy concern because the skill enforces one language by default without opt-in.

Context-Inappropriate Capability

Medium
Confidence
85% confidence
Finding
The stated purpose is to monitor Binance account, positions, and funding income. Reading payment-service API credentials from environment variables introduces a separate monetization/integration capability that is not necessary to perform monitoring and is not declared in the manifest description.

External Transmission

Medium
Category
Data Exfiltration
Content
# SkillPay 支付验证 - 从环境变量读取
SKILLPAY_API_KEY = os.getenv("SKILLPAY_API_KEY", "")
SKILLPAY_ENDPOINT = os.getenv("SKILLPAY_ENDPOINT", "https://api.skillpay.me/v1")

# 币安监控模块 - 使用本地副本
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
Confidence
88% confidence
Finding
The code is configured to transmit data to an external endpoint (`api.skillpay.me`) for payment verification, which is a real external data flow. In this skill’s context, outbound transmission is not inherently malicious, but it becomes security-relevant because it occurs automatically and can expose session-linked metadata to a third party.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The manifest description focuses on account/position/PnL monitoring for Binance. This file adds a separate billing capability by calling an external SkillPay API and gating every tool on payment status, which is not mentioned in the manifest description and is not an obvious implementation detail of monitoring itself.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
Payment verification transmits `session_id`, skill name, and billing metadata to an external API without any user-facing notice or consent flow. Even if this is functionally required for billing, silent third-party transmission of session-linked data creates privacy and tracking risk, especially if session identifiers are reusable or correlate to user accounts.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The tool returns highly sensitive financial information including account balances, margin usage, positions, and funding income without any explicit consent, warning, or access-control checks beyond payment status. In an MCP context, exposing brokerage/account data through tool calls can leak private financial details to the invoking client or downstream logs if used unintentionally or by a compromised session.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The manifest explicitly requests Binance API credentials and exposes tools that access account balances, positions, and income, but it does not provide any user-facing warning about the sensitivity of financial account data or recommended key restrictions. In a paid third-party skill handling exchange credentials, this omission increases the risk that users provide overly privileged keys without understanding exposure, misuse, or data-sharing implications.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The startup script automatically sources both SkillPay and Binance environment files, giving the skill access to billing and exchange credentials at launch. For a monitoring skill this may be operationally necessary, but it still expands secret exposure and creates a real risk if the server code, dependencies, or later modifications misuse those credentials.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The script imports credential-bearing environment files without any visible warning, consent prompt, or disclosure in the startup path. That lack of transparency is dangerous because users may believe they are running a simple monitoring tool while it silently gains access to sensitive payment and exchange credentials.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
All visible user-facing instructions in the file are in Chinese, and the document does not indicate that other languages are supported or that Chinese is a justified locale requirement. The audit rules call for flagging language or locale policy violations when a skill effectively forces a specific language without user opt-in.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
The user-facing description and instructions are primarily in Chinese, and the file does not indicate that this locale restriction is optional, user-selectable, or justified as region-specific. The policy for natural-language content requires avoiding forced language constraints unless users are given a choice or the limitation is clearly documented.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
Natural-language strings, comments, docstrings, exceptions, and logs in this file are written in Chinese, which imposes a specific language on users and operators. The file does not indicate that Chinese is optional, configurable, or justified as a region-specific tool.

Unpinned Dependencies

Low
Category
Supply Chain
Content
mcp>=1.0.0
requests>=2.28.0
python-dotenv>=1.0.0
Confidence
97% confidence
Finding
The dependency is specified with a lower bound only (`mcp>=1.0.0`), which allows future versions to be installed without review. This creates supply-chain and reproducibility risk because a vulnerable or breaking release could be pulled in later, and the skill context is somewhat more sensitive because `mcp` is directly involved in agent/server functionality and already has multiple known advisories.

Unverifiable Dependency: mcp has 12 known advisory(ies) (CVE-2025-53366 (MCP Python SDK vulnerability in the FastMCP Server causes validation error, lead); CVE-2025-66416 (Model Context Protocol (MCP) Python SDK does not enable DNS rebinding protection); CVE-2026-52870 (MCP Python SDK: Experimental task handlers allow any client to access and cancel) +9 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
92% confidence
Finding
The manifest does not pin `mcp`, and the package has multiple known advisories, so it is impossible to verify from this file whether the installed version is affected. This is dangerous because the skill relies on MCP infrastructure, and if a vulnerable release is resolved at install time it could expose agent/server functionality to network or protocol-level attacks.

Unpinned Dependencies

Low
Category
Supply Chain
Content
mcp>=1.0.0
requests>=2.28.0
python-dotenv>=1.0.0
Confidence
96% confidence
Finding
`requests>=2.28.0` is unpinned, so builds are not reproducible and can silently consume newly published versions. That is dangerous because `requests` is a network-facing library with a history of advisories, and this skill appears to interact with exchange/account data where HTTP handling errors can expose credentials or sensitive responses.

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding
Because `requests` is not pinned, the actual installed version cannot be checked against its known advisory set from the manifest alone. That uncertainty is risky in a tool likely making authenticated HTTP requests to Binance-related services, where a vulnerable HTTP client could contribute to credential leakage, redirect abuse, or unsafe request handling.

Unpinned Dependencies

Low
Category
Supply Chain
Content
mcp>=1.0.0
requests>=2.28.0
python-dotenv>=1.0.0
Confidence
95% confidence
Finding
`python-dotenv>=1.0.0` permits any later release, which weakens build integrity and makes it hard to know what code will actually run. In this skill context, environment files may contain API keys or exchange secrets, so pulling an unreviewed version raises confidentiality and integrity concerns.

Static analysis

No suspicious patterns detected.