T09 · Insecure Skill Coding Practices
- Location
configure.py:45- Finding
Wallet Private Key Exposed Through Process Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a disclosed Polymarket trading skill, but it handles a wallet private key and can place live orders with weak safeguards and unsafe secret handling.
Review this carefully before installing. Use only a dedicated low-value wallet, avoid enabling autonomous mode, do not run config commands that print secrets, and treat any trade command as a real financial action. The skill should add secret redaction, safer key storage, pinned dependencies, dry-run mode, strict order validation, and explicit per-trade limits before use with meaningful funds.
configure.py:45Wallet Private Key Exposed Through Process Arguments
cli.py:45Arbitrary Configuration Reads Can Print the Wallet Private Key
requirements.txt:1Unpinned Dependencies Create a Mutable Supply-Chain Execution Path
trade.py:47Missing Order Validation Can Produce Unintended Financial Actions
The content allows authenticated balance access and live Polymarket order placement while claiming core capabilities such as analysis and opportunity identification that are not actually implemented in the skill file itself. That mismatch increases the chance of users authorizing a trading tool under the mistaken belief that robust analytical safeguards exist when the real behavior is primarily account access and execution.
The content allows authenticated balance access and live Polymarket order placement while claiming core capabilities such as analysis and opportunity identification that are not actually implemented in the skill file itself. That mismatch increases the chance of users authorizing a trading tool under the mistaken belief that robust analytical safeguards exist when the real behavior is primarily account access and execution.
The content allows authenticated balance access and live Polymarket order placement while claiming core capabilities such as analysis and opportunity identification that are not actually implemented in the skill file itself. That mismatch increases the chance of users authorizing a trading tool under the mistaken belief that robust analytical safeguards exist when the real behavior is primarily account access and execution.
The content allows authenticated balance access and live Polymarket order placement while claiming core capabilities such as analysis and opportunity identification that are not actually implemented in the skill file itself. That mismatch increases the chance of users authorizing a trading tool under the mistaken belief that robust analytical safeguards exist when the real behavior is primarily account access and execution.
The skill explicitly mentions executing trades 'autonomously if configured' but does not present a strong, up-front warning that these are real-money actions with financial loss potential. In a trading context, unclear disclosure of autonomous real-asset execution is especially dangerous because users may enable it without appreciating that the agent can place live orders using their credentials.
Using shell=True expands the attack surface because the shell interprets the command string and environment, enabling injection and unexpected behavior if inputs ever become variable. Even though the present commands are hardcoded health checks, this pattern is especially unsafe in an agent skill where future maintenance could easily introduce attacker-influenced command content.
for name, cmd in checks:
try:
subprocess.run(cmd, shell=True, check=True, capture_output=True)
console.print(f" [green]✔[/green] {name}")
except:
console.print(f" [red]✘[/red] {name} - NOT FOUND")
This file performs authenticated live trading by posting orders to Polymarket, which exceeds a stated analysis/research-only expectation and creates a capability mismatch. In an autonomous agent context, that mismatch is dangerous because users or orchestrators may invoke the skill assuming it is informational, while it can directly move funds and create irreversible market positions.
The order placement path immediately creates and posts a live order with no confirmation prompt, preview, or secondary authorization. For an autonomous prediction-market agent, this makes accidental, prompt-influenced, or mis-parameterized trades easy to execute, potentially causing direct financial loss and unwanted exposure.
The README explicitly advertises trading functionality for an autonomous prediction market agent but provides no warning that commands may trigger financial actions, consume funds, or interact with external systems. In this context, missing safety and authorization guidance can mislead users into running commands without understanding the potential monetary and operational consequences.
The skill advertises shell, network, and environment-dependent behavior but does not declare any explicit tool scope or allowed-tools restrictions. That creates an overbroad execution surface where an agent may invoke powerful capabilities implicitly, reducing user visibility and policy enforcement around network access, shell execution, and secret handling.
The manifest description is broad enough to match generic trading, research, or market-analysis requests, making accidental selection more likely. In this context, accidental activation is more dangerous because the skill also exposes operational capabilities related to authenticated market interaction and automation.
The skill defines broad activation behavior such as responding to generic requests like analyzing Polymarket opportunities, which can overlap with ordinary research or finance prompts. Overbroad triggers increase the chance of unintended invocation of a high-risk skill that can access balances, set cron jobs, or prepare trades in contexts where the user did not clearly request execution-oriented assistance.
The skill instructs the agent to create cron jobs for ongoing monitoring, which introduces persistence beyond the current session. Persistent scheduled behavior can continue accessing market data or prompting action later, and in a trading-related context this expands the risk of unintended automation, surprise notifications, or future actions tied to sensitive financial workflows.
| "What's my balance?" | Run `poly balance` |
| "Any crypto opportunities?" | `poly markets "crypto"` + research + recommend |
| "News on [topic]" | Web search + find related markets + analyze |
| "Set alert for [market]" | Create cron job to monitor |
| "What happened to [market]?" | Check resolution, explain outcome |
| "How much should I bet?" | Calculate Kelly Criterion based on edge and bankroll |
The manifest uses Chinese for the user-facing name and description, which indicates a fixed language choice in natural-language metadata. The file provides no opt-in, alternative locale, or explanation that this skill is intentionally region- or language-specific.
The manifest says the skill analyzes markets, researches news, and identifies trading opportunities, suggesting autonomous analytical behavior. In this file, most implemented commands are for local configuration, health checks, manual buy/sell execution, and toggling config flags, while the advertised analysis capability is only a printed instruction to ask another agent rather than actual analysis logic.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"""
script_dir = os.path.dirname(os.path.abspath(__file__))
setup_script = os.path.join(script_dir, "configure.py")
subprocess.run([sys.executable, setup_script])
@app.command(rich_help_panel="Setup")
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# Set config
cmd = ["clawdbot", "config", "set", f"skills.entries.polymarket-agent.env.{key}", value]
try:
subprocess.run(cmd, check=True)
console.print(f"[green]✔ Set {key} = {value}[/green]")
except Exception as e:
console.print(f"[red]✘ Failed: {e}[/red]")
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
# Set config
cmd = ["clawdbot", "config", "set", f"skills.entries.polymarket-agent.env.{key}", value]
try:
subprocess.run(cmd, check=True)
console.print(f"[green]✔ Set {key} = {value}[/green]")
except Exception as e:
console.print(f"[red]✘ Failed: {e}[/red]")
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# Get config
cmd = ["clawdbot", "config", "get", f"skills.entries.polymarket-agent.env.{key}"]
try:
result = subprocess.run(cmd, capture_output=True, text=True)
console.print(f"[cyan]{key}[/cyan] = {result.stdout.strip()}")
except Exception as e:
console.print(f"[red]✘ Failed: {e}[/red]")
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
# Get config
cmd = ["clawdbot", "config", "get", f"skills.entries.polymarket-agent.env.{key}"]
try:
result = subprocess.run(cmd, capture_output=True, text=True)
console.print(f"[cyan]{key}[/cyan] = {result.stdout.strip()}")
except Exception as e:
console.print(f"[red]✘ Failed: {e}[/red]")
This code uses subprocess.run with shell=True, which is inherently risky because it delegates parsing to the shell. In the current code the commands are hardcoded dependency checks, so immediate exploitability is limited, but future modification or accidental user influence could turn this into command injection or unexpected shell execution.
for name, cmd in checks:
try:
subprocess.run(cmd, shell=True, check=True, capture_output=True)
console.print(f" [green]✔[/green] {name}")
except:
console.print(f" [red]✘[/red] {name} - NOT FOUND")
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
for name, cmd in checks:
try:
subprocess.run(cmd, shell=True, check=True, capture_output=True)
console.print(f" [green]✔[/green] {name}")
except:
console.print(f" [red]✘[/red] {name} - NOT FOUND")
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
token_id: str = typer.Argument(..., help="Token ID to buy"),
price: float = typer.Argument(..., help="Limit price (0.01 - 0.99)"),
size: float = typer.Argument(..., help="Amount to buy"),
confirm: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation"),
):
"""
💰 **Place a BUY order** on a market outcome.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
token_id: str = typer.Argument(..., help="Token ID to buy"),
price: float = typer.Argument(..., help="Limit price (0.01 - 0.99)"),
size: float = typer.Argument(..., help="Amount to buy"),
confirm: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation"),
):
"""
💰 **Place a BUY order** on a market outcome.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
script_dir = os.path.dirname(os.path.abspath(__file__))
trade_script = os.path.join(script_dir, "trade.py")
subprocess.run([sys.executable, trade_script, token_id, "BUY", str(price), str(size)])
@app.command(rich_help_panel="Trading")
No suspicious patterns detected.