T09 · Insecure Skill Coding Practices
- Location
lib/wallet.ts:23- Finding
Hard-Coded Oracle API Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
Review recommended because this prediction-market skill can move UCT tokens and use wallet secrets, but its safeguards and disclosures are not strong enough for that authority.
Use this only with funds you are willing to risk, preferably on testnet. Before installing, confirm the server endpoint, avoid custom or plaintext endpoints, review the wallet and private-key handling, and do not run deposit or withdrawal commands unless you personally verify the amount and destination.
lib/wallet.ts:23Hard-Coded Oracle API Credential
lib/api.ts:13Request Signatures Do Not Bind the HTTP Method, Path, or Destination
lib/config.ts:4Configurable API Endpoint Permits Plaintext or Attacker-Controlled Servers
scripts/deposit.ts:24Deposit Sends Tokens to an Unverified Server-Supplied Address
scripts/trade.ts:28Financial Inputs Are Parsed Without Strict Validation
The skill description emphasizes trading and position management, but the file also includes a withdrawal feature that transfers tokens to arbitrary external addresses. That is a materially different and higher-risk capability because it enables direct asset exfiltration, and it is not highlighted in the top-level description or permission model.
The skill description emphasizes trading and position management, but the file also includes a withdrawal feature that transfers tokens to arbitrary external addresses. That is a materially different and higher-risk capability because it enables direct asset exfiltration, and it is not highlighted in the top-level description or permission model.
The skill description emphasizes trading and position management, but the file also includes a withdrawal feature that transfers tokens to arbitrary external addresses. That is a materially different and higher-risk capability because it enables direct asset exfiltration, and it is not highlighted in the top-level description or permission model.
The skill description emphasizes trading and position management, but the file also includes a withdrawal feature that transfers tokens to arbitrary external addresses. That is a materially different and higher-risk capability because it enables direct asset exfiltration, and it is not highlighted in the top-level description or permission model.
The skill description emphasizes trading and position management, but the file also includes a withdrawal feature that transfers tokens to arbitrary external addresses. That is a materially different and higher-risk capability because it enables direct asset exfiltration, and it is not highlighted in the top-level description or permission model.
Referenced artifact was not completely inspected
npx tsx scripts/market.ts list
Referenced artifact was not completely inspected
npx tsx scripts/market.ts list
Referenced artifact was not completely inspected
npx tsx scripts/trade.ts buy --market <id> --side yes --price 0.35 --qty 10
Referenced artifact was not completely inspected
npx tsx scripts/trade.ts buy --market <id> --side yes --price 0.35 --qty 10
Referenced artifact was not completely inspected
npx tsx scripts/trade.ts buy --market <id> --side yes --price 0.35 --qty 10
Referenced artifact was not completely inspected
npx tsx scripts/trade.ts buy --market <id> --side yes --price 0.35 --qty 10
Referenced artifact was not completely inspected
npx tsx scripts/portfolio.ts balance
Referenced artifact was not completely inspected
npx tsx scripts/portfolio.ts balance
The code silently reads a mnemonic from disk and restores a wallet without any user-facing disclosure or consent at the point of use. In an agent skill context, hidden access to seed phrases materially increases the risk of unauthorized signing, wallet surveillance, or later exfiltration of the most sensitive wallet secret.
This helper deliberately bypasses the SDK's public safety boundary by reaching into the internal _identity object to return the raw private key. Exposing a reusable private key is far more powerful than the stated trading functionality requires, and any downstream code, logging, compromise, or prompt-driven misuse could exfiltrate the wallet and enable irreversible theft of funds or impersonation.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
- Body: `{ "side": "yes"|"no", "price": 0.35, "quantity": 10 }`
- Response: `{ "orderId": 1, "fills": [{ "price": 0.35, "quantity": 5, "counterpartyOrderId": 2 }] }`
### DELETE /api/agent/markets/:id/orders/:orderId
Cancel an order.
- Response: `{ "cancelled": true }`
The skill declares no explicit tool scope or permissions even though it clearly relies on environment access, local wallet files, and network communication. In a financial skill that can move tokens and interact with a remote server, missing scope declarations reduce transparency and can cause an agent or user to authorize broader capabilities than expected.
The skill instructs users to register an account and deposit funds to a server-backed trading balance, implying persistent off-chain session or account state tied to wallet identity. Persistence itself is expected for a trading platform, but it becomes security-relevant because long-lived authenticated state and stored balances increase the consequences of credential misuse or server compromise.
Use the unicity_top_up agent tool, or: openclaw unicity top-up
2. **Register** — create your UniClaw account
npx tsx scripts/register.ts
Using npx tsx without pinning a version allows execution behavior to depend on whatever package version is resolved at runtime. That creates a supply-chain risk where a compromised or changed upstream package could execute unintended code in a context that has wallet and network access.
The deposit step instructs users to send tokens directly to the UniClaw server but does not clearly warn that this is a custodial transfer where control shifts from the user's wallet to the service. In a financial context, lack of explicit custody and privacy disclosure can mislead users about the risk of loss, account freezing, or off-chain handling of balances.
The unpinned npx tsx invocation makes the registration flow dependent on an externally resolved package version. Because registration likely uses wallet identity and network access, a malicious package update could harvest credentials or alter requests.
An unversioned npx tsx invocation is a supply-chain exposure because runtime code may change independently of the skill contents. In a token trading workflow, that can directly affect order-related actions and any secrets loaded from the wallet path.
The detail command also depends on mutable npx tsx resolution. Even read-oriented commands are risky because the runtime may still access environment variables, wallet files, or network endpoints under attacker-controlled package behavior.
Executing trade placement via unpinned npx tsx is more dangerous than read-only operations because it can trigger asset-affecting actions. A compromised runtime package could tamper with order parameters, leak wallet material, or submit unauthorized requests while appearing to place a normal trade.
The NO-side trade command carries the same supply-chain risk as the YES-side command, but in a value-transferring context where collateral is committed. Mutable runtime resolution could change business logic, exfiltrate credentials, or place unintended orders.
No suspicious patterns detected.