T09 · Insecure Skill Coding Practices
- Location
SKILL.md:69- Finding
Agent Workflow Requests and Exposes a Wallet Private Key Through the Process Environment
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:69-72
Vulnerability Type: Sensitive credential handling
Risk Level: MediumVulnerable Code
markdown 2. **Ask for wallet private key** (required for live trading) - This is the private key for their Polymarket wallet (the wallet that holds USDC) - Store in environment as `WALLET_PRIVATE_KEY` - The SDK uses this to sign orders client-side automatically — no manual signing neededRelated troubleshooting instructions at
SKILL.md:261-265reinforce this design:markdown - `WALLET_PRIVATE_KEY` is not set in the environment - The SDK signs orders automatically when this env var is present — no manual signing code needed - Fix: `export WALLET_PRIVATE_KEY=0x<your-polymarket-wallet-private-key>` - Do NOT attempt to sign orders manually or modify the skill code — the SDK handles itTechnical Analysis
The setup workflow directs the AI Agent to ask the user for a raw wallet private key and store it in an environment variable. A wallet private key is a high-impact bearer secret: possession normally permits signing transactions for the corresponding wallet without additional authorization.
Local signing is relevant to live Polymarket trading, but involving the Agent in raw-key collection exceeds the safest minimum-privilege design. A secret placed in the process environment may be accessible to inherited child processes, third-party libraries, diagnostic tools, crash reporters, or other processes operating under the same account, depending on the runtime and operating-system configuration.
The audited project does not directly read or transmit
WALLET_PRIVATE_KEY. Its documentation states that the externalsimmer-sdkconsumes the variable for client-side signing. Therefore, this finding concerns unsafe credential handling and delegation, not confirmed exfiltration by the project code.Attack Path
- A user follows t ...[truncated 938 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not request wallet private keys through an AI conversation or ordinary Agent setup workflow.
- Integrate with an isolated signer, hardware wallet, delegated signing service, or wallet-provider API.
- If local signing is unavoidable, accept the key through a protected secret manager or interactive no-echo prompt rather than chat or ordinary configuration.
- Use a dedicated, low-value trading wallet with narrowly limited funds and token approvals.
- Prevent secret inheritance by unrelated child processes and isolate the signer from nonessential dependencies.
- Ensure logs, exception reports, telemetry, shell history, and configuration displays always redact secrets.
- Document wallet-key rotation, revocation, incident response, and fund-migration procedures.
