Back to skill

Security audit

Broadcast Sign Transfer

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it handles real wallet keys and irreversible transfers with unsafe defaults and sensitive logging that users should review before installing.

Only install this if you understand it can move funds from the configured wallet. Use a low-balance dedicated wallet, avoid storing private keys in shell startup files, avoid running it in shared or logged environments, inspect transactions before broadcasting, and remove or disable debug logging of signed transactions and OKX signatures.

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/broadcast_sign_transfer.py:237
Finding

Sensitive API authorization and signed transaction material exposed through debug logging

Content
View full analysis
dict: timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z" sign = self._okx_sign(timestamp, method, path, body) print(f" [DEBUG] timestamp: {timestamp}") print(f" [DEBUG] method: {method}") print(f" [DEBUG] path: {path}") print(f" [DEBUG] body: {body}") print(f" [DEBUG] sign: {sign}") return { "OK-ACCESS-KEY": str(self.api_key), "OK-ACCESS-SIGN": str(sign), "OK-ACCESS-PASSPHRASE": str(self.passphrase), "OK-ACCESS-TIMESTAMP": str(timestamp), "Content-Type": "application/json", } ``` The signed transactions are also printed by both transfer operations: ```python signed_tx = self._sign_native_tx(to_address, amount_wei) print(f" signed_tx: {signed_tx}") return self._broadcast(signed_tx, enable_mev_protection) ``` ```python signed_tx = self._sign_token_tx(token_address, to_address, amount_raw) print(f" signed_tx: {signed_tx}") return self._broadcast(signed_tx, enable_mev_protection) ``` ### Technical Analysis The Skill writes the complete OKX request body, timestamp, request path, request method, HMAC authorization signature, and raw signed transaction to standard output. The Base64 operation used to produce the OKX signature is ordinary encoding of an HMAC-SHA256 digest and is not, by itself, a covert exfiltration mechanism. The security problem is that the encoded signature and every input needed to reproduce the authenticated request are printed together. The request body includes the wallet address and signed transaction. The raw signed transaction does not expose the wallet private key and cannot be modified ...[truncated 1672 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:160
Finding

Documentation instructs users to persist a wallet private key in a plaintext shell startup file

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:264
Finding

Security-sensitive dependencies are installed without version or integrity pinning

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/broadcast_sign_transfer.py:359
Finding

Floating-point arithmetic can produce incorrect irreversible transfer amounts

Content
View full analysis
BroadcastResult: """ Transfer native tokens. """ if not to_address or not to_address.startswith("0x"): raise ValueError("to_address format error") if amount <= 0: raise ValueError("amount must be greater than 0") amount_wei = self.w3.to_wei(amount, "ether") ``` ERC-20 transfers multiply a floating-point amount and truncate it to an integer: ```python def transfer_token( self, token_address: str, to_address: str, amount: float, enable_mev_protection: bool = False, ) -> BroadcastResult: """ Transfer ERC20 tokens. """ if not token_address or not token_address.startswith("0x"): raise ValueError("token_address format error") if not to_address or not to_address.startswith("0x"): raise ValueError("to_address format error") if amount <= 0: raise ValueError("amount must be greater than 0") contract = self.w3.eth.contract( address=Web3.to_checksum_address(token_address), abi=ERC20_ABI, ) decimals = contract.functions.decimals().call() symbol = contract.functions.symbol().call() amount_raw = int(amount * (10 ** decimals)) ``` ### Technical Analysis Python `float` uses binary floating-point representation and cannot exactly represent many decimal financial values. Multiplication by a token's decimal scale can therefore result in a value slightly above or below the intended integer amount. For ERC-20 transfers, `int()` truncates rather than performing an explicit, validated roundi ...[truncated 1311 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (7)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The public transfer methods sign and broadcast irreversible on-chain transactions immediately once called, with no explicit confirmation, review step, transaction preview, or policy gate. In a skill that holds a private key and can move blockchain assets, this is especially dangerous because any accidental invocation, prompt injection in a larger agent workflow, parameter tampering, or misuse can directly cause unrecoverable loss of funds.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill explicitly requires environment secrets such as a wallet private key and OKX API credentials and describes network-based transaction broadcasting, but it does not declare any tool scope or permission boundaries. In an agent setting, this omission can lead to overbroad access to sensitive environment variables and outbound network actions without transparent authorization, which is especially dangerous because the skill performs irreversible blockchain transfers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User-facing documentation, error messages, and CLI help throughout the file are presented in Chinese, with no indication that the user can select another language. This creates a language/locale policy issue because the skill effectively imposes one language without opt-in or justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script accesses a wallet private key and exchange API credentials directly from environment variables, which gives the skill the ability to sign and broadcast real asset transfers. In this skill context, that capability is expected for functionality, but it is still highly sensitive because any misuse, logging, process compromise, or untrusted invocation path can lead to immediate theft or unauthorized transactions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code relies on highly sensitive private-key and API-key material without prominent in-code warnings or protective handling guidance, despite enabling direct financial operations. In this context, poor operator awareness materially raises the chance of unsafe deployment, credential leakage, or use in an untrusted runtime.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module docstring instructs users to import BroadcastTransaction from broadcast_transaction, but this file actually defines the implementation in broadcast_sign_transfer.py. This is an active documentation/code inconsistency that misstates how the skill is used.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest describes a skill for constructing, signing, and broadcasting native token and ERC20 transfers. However, the embedded ERC20 ABI also includes the allowance read method, which enables approval/authorization inspection even though no approval flow or spender-based transfer behavior is part of the declared purpose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.