T09 · Insecure Skill Coding Practices
- Location
polymarket-trade.js:291- Finding
Automatic Trading Logic Executes Unhedged Speculative Orders Instead of Arbitrage
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a high-risk Polymarket trading bot that asks for a wallet private key and is designed to place recurring live orders without clear confirmations, limits, or safe default controls.
Review this carefully before installing. Do not use a primary wallet private key; if testing, use a dedicated low-balance wallet and assume any configured funds could be traded automatically. Treat scan/start as potentially live-trading workflows, and avoid use unless you are comfortable with the lack of confirmations, limits, and reliable arbitrage safeguards.
polymarket-trade.js:291Automatic Trading Logic Executes Unhedged Speculative Orders Instead of Arbitrage
polymarket-trade.js:172Billing API Key and Wallet Identifier Are Transmitted to an External Service
polymarket-trade.js:187Billing Enforcement Fails Open and Sends a Zero-Amount Charge
The skill description markets 'automatic detection and execution of arbitrage trades' and states that each invocation auto-charges fees, but it does not clearly foreground that the skill may place real-money trades without per-trade user confirmation. In a financial trading context, silent or background execution materially raises the chance of unintended orders, loss of funds, and abuse if the skill is misconfigured or behaves unexpectedly.
The README explicitly instructs users to export and provide a raw Polygon wallet private key via an environment variable for automated trading. Requesting direct custody secrets in a third-party skill materially increases wallet-compromise risk, especially because the skill is designed to execute financial transactions and gives only minimal generic trading-risk warnings rather than strong credential-handling warnings.
The documented behavior understates several highly sensitive actions: use of a raw private key for signing, communication with an external billing service, and continuous monitoring or polling. This mismatch is especially dangerous because users may believe they are invoking a simple arbitrage helper while actually granting a skill the ability to spend crypto assets, incur charges, and run persistent automated activity.
The scan command can place real market orders automatically whenever a wallet is configured, without any explicit user confirmation, dry-run default, max-loss guard, or final warning. Because this directly triggers live financial transactions from routine discovery logic, accidental invocation or misleading integration could cause immediate unwanted spending and market exposure.
The start command enables unattended recurring scans every 60 seconds, and those scans may submit live orders automatically if a wallet is present. This compounds the previous issue by allowing repeated real-money trades with no operator approval per cycle, no circuit breaker, and no visible risk acknowledgement, increasing the chance of runaway losses or abuse.
The skill advertises capabilities that require environment access and network communication, but it declares no explicit tool scope or permissions. In a security-sensitive context involving wallet keys and automated trading, missing scope declarations hide the real trust boundary and can cause users or platforms to authorize a skill without understanding that it can access secrets and interact with external services.
The skill explicitly instructs users to export and provide a raw Polygon private key for automated trading, without strong warnings against key reuse, hot-wallet risk, or safer alternatives. Because a raw private key grants full control over wallet funds, any compromise, misuse, or hidden transaction logic could result in irreversible theft of crypto assets.
User-facing descriptions, logs, help text, and warnings are written in Chinese throughout the file, with no indication that the skill is region-specific or that users may choose another language. This can violate language/locale policy where skills must not force a specific language without user opt-in.
The code does not enforce paid access before executing the scan/trading flow. If SKILLPAY_KEY is missing or the charge request errors, chargeUser() returns success and the program continues, allowing use of the skill contrary to the stated billing model. In a paid trading skill this is a real integrity/business-logic flaw, though not as severe as direct fund theft.
The visible user-facing description and instructions are entirely in Chinese, and the file does not offer an alternative language or state that the skill is region-specific. Under the language/locale policy, forcing a specific language without user opt-in can be a natural-language policy violation.
The manifest description is written only in Chinese ("Polymarket预测市场套利工具"), which imposes a specific language presentation without any indication of user opt-in or locale-specific justification. This matches the policy category for language or locale constraints expressed in natural language.
Using caret ranges for dependencies allows newer package versions to be installed without explicit review, which can introduce supply-chain risk, behavioral changes, or inadvertently pull in a vulnerable release. In a trading/arbitrage skill that may handle API calls and blockchain interactions, unexpected dependency changes can have outsized financial impact.
"node": ">=14"
},
"dependencies": {
"node-fetch": "^2.7.0",
"ethers": "^5.7.2"
}
}
The manifest references node-fetch without pinning an exact version, while known advisories exist for some releases, making it impossible to verify from this file alone whether deployments are affected. In a tool that likely performs network requests for market data or execution, vulnerable HTTP client behavior could expose sensitive headers, enable denial-of-service conditions, or weaken request safety.
Using a non-exact version for ethers permits automatic uptake of newer compatible releases, increasing supply-chain risk and the chance of unexpected runtime or security-impacting changes. Because this skill is described as executing arbitrage trades and charging per invocation, dependency drift in a blockchain library can directly affect transaction construction, signing, or fund handling.
},
"dependencies": {
"node-fetch": "^2.7.0",
"ethers": "^5.7.2"
}
}
The file header and CLI help both state that POLYMARKET_PRIVATE_KEY is required. In practice, initWallet only logs a warning and returns false, and scan can still execute market scanning and billing-related network calls without a wallet; only order placement is gated.