Back to skill

Security audit

Polymarket Trader

Security checks for vulnerabilities and agentic risk

Overview

This skill openly places Polymarket trades, but it gives an agent direct wallet-backed trading authority with weak validation and an unsafe shell command wrapper.

Install only if you are comfortable giving the skill live Polymarket trading authority. Use a minimally funded dedicated wallet, review each requested trade yourself, and avoid untrusted market_slug or direction inputs until the shell invocation, local order validation, explicit confirmation, and order-size limits are fixed.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:23
Finding

Shell Injection Through Unsafely Interpolated Tool Arguments

Content
View full analysis
source ../../polymarket_venv/bin/activate && export MARKET_SLUG='{{market_slug}}' && export DIRECTION='{{direction}}' && export PRICE={{price}} && export SIZE={{size}} && python trade.py ``` ### Technical Analysis Tool arguments are interpolated directly into a command interpreted by a shell. Assigning values to environment variables does not prevent command injection when those assignments are themselves assembled as shell source code. `market_slug` and `direction` are enclosed in single quotes, but an input containing a single quote can terminate the quoted value and introduce shell operators or additional commands. `price` and `size` are interpolated without any shell quoting. Although those fields are declared as numbers, the command remains dependent on the surrounding tool framework enforcing that type before interpolation. This behavior directly contradicts the comment claiming that environment-variable use prevents shell injection. No strict allowlist, shell escaping mechanism, or argument-array execution boundary is present in the supplied configuration. ### Attack Path 1. An attacker or untrusted caller supplies a crafted `market_slug` or `direction` containing a quote followed by shell syntax. 2. The template engine substitutes that input directly into the `command` string. 3. The injected quote terminates the intended environment-variable value. 4. The shell interprets the remaining text as operators and commands. 5. The injected command runs with the same operating-system identity, filesystem access, environment, an ...[truncated 928 chars]
Remediation
View remediation
DIRECTION: PRICE: SIZE: ``` 5. Enforce an allowlist for `direction`, strict numeric schemas for `price` and `size`, and a conservative character/length policy for market slugs before process invocation. 6. Do not rely solely on shell escaping. If a shell is unavoidable, use a trusted escaping API and reject values outside the expected grammar. 7. Run the Skill under a restricted account with minimal filesystem and network permissions. 8. Use a dedicated, minimally funded wallet so compromise of the process environment has limited financial impact. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
trade.py:63
Finding

Insufficient Order Validation and Incorrect Side Selection for the No Outcome

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code reads a live Polymarket private key from an environment variable, derives API credentials, and initializes a client capable of submitting authenticated market orders. In an agent skill of unknown purpose, this grants direct financial transaction capability and exposes sensitive signing material to any workflow that can invoke the skill, making unauthorized or unintended trades possible.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill makes outbound requests to Polymarket APIs to resolve market data and then uses that data to support order placement, creating an external action path with real-world financial effect. Because the skill has no declared scope, approval gate, or destination restrictions beyond hardcoded endpoints, it increases the risk of unauthorized network-driven trading activity.

Content

No source excerpt is available for this finding.