Back to skill

Security audit

Polymarket Pmxt Trader

Security checks for vulnerabilities and agentic risk

Overview

This skill is a financial trading automation that needs review because it can use trading credentials and its documented live-trading safeguards do not match the implementation.

Review this carefully before installing. Use dry-run only unless you fully accept the risk of automated Polymarket trading, restrict API keys to the minimum permissions possible, avoid exposing wallet keys, and do not rely on the advertised safeguards until the implementation actually enforces them.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
pmxt_trader.py:40
Finding

PMXT API key exposed in process command-line arguments

Content
View full analysis
dict: if not PMXT_API_KEY: return {"error": "PMXT_API_KEY not set"} payload = json.dumps({"args": [params or {}]}) env = os.environ.copy() r = subprocess.run( ["curl", "-s", "--max-time", "10", f"{PMXT_BASE}/{exchange}/{method}", "-X", "POST", "-H", f"Authorization: Bearer {PMXT_API_KEY}", "-H", "Content-Type: application/json", "-d", payload], capture_output=True, text=True, timeout=12, env=env) ``` ### Technical Analysis The PMXT bearer token is interpolated directly into the `curl` process argument list. Although the code does not invoke a shell and therefore does not introduce shell injection at this location, command-line arguments can be exposed through process inspection facilities, privileged monitoring agents, diagnostic tooling, or process accounting. The child process also inherits a complete copy of the parent environment through `os.environ.copy()`. This grants `curl` access to all environment variables available to the Skill, including unrelated credentials, even though only ordinary networking configuration may be necessary. Sending `PMXT_API_KEY` to the declared HTTPS PMXT endpoint is necessary for the Skill's market-data functionality. The vulnerability is the command-line transport and excessive child-process environment, not the authorized network request itself. ### Attack Path 1. An attacker obtains local process-inspection capability or access to process-monitoring records on the host. 2. The scheduled Skill starts a PMXT request and launches `curl`. 3. The attacker observes the `curl` argument list while the process is active. 4. The Authorization argument r ...[truncated 552 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
clawhub.json:5
Finding

Security-sensitive trading dependency is not version or integrity pinned

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:20
Finding

Documented live-trading safeguards are absent or materially incomplete

Content
View full analysis
= MAX_TRADES_PER_RUN: break price = opp["yes_price"] mid_pct = price * 100 # Smart sizing if args.smart_sizing: position_size = get_sizing(balance) else: position_size = min(MAX_POSITION_USD, balance * 0.05) position_size = round(position_size, 2) # max 2 decimal places if balance < 0.50: print(f" Balance too low (${balance:.2f}), stopping") break reasoning = (f"PMXT signal: {opp['signal']} | " f"YES {mid_pct:.1f}¢ | " f"volume ${opp['volume']:,.0f} | " f"{opp['title'][:60]}") ``` The configured schedule is: ```json "cron": "*/5 * * * *" ``` ### Technical Analysis The implementation pr ...[truncated 2608 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (9)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
96% confidence
Finding

os.environ.copy() passes the full environment to the curl subprocess, potentially exposing unrelated secrets, tokens, and sensitive runtime configuration to a child process that does not need them. In an agent or automation environment, environment blocks often contain high-value credentials, so broad inheritance materially increases secret leakage risk if the subprocess, host, or diagnostics are compromised.

Content

Scanner excerpt · pmxt_trader.py (reported line 41)May include surrounding context.

python
if not PMXT_API_KEY:
        return {"error": "PMXT_API_KEY not set"}
    payload = json.dumps({"args": [params or {}]})
    env = os.environ.copy()
    r = subprocess.run(
        ["curl", "-s", "--max-time", "10",
         f"{PMXT_BASE}/{exchange}/{method}",

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents capabilities that rely on environment variables and shell execution, but it does not declare an explicit tool scope such as permissions or allowed-tools. In an agent framework, this can cause the skill to run with broader ambient privileges than intended, increasing the chance of unauthorized command execution or secret exposure if the skill is invoked in a permissive runtime.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The usage section advertises a '--live' mode for real-money trading but does not provide a clear, explicit warning that this can execute irreversible financial transactions. In the context of an autonomous trading skill, omission of that warning makes accidental misuse more likely and increases the risk that a user or agent enables live trading without understanding the monetary consequences.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · pmxt_trader.py (reported line 23)May include surrounding context.

python
# ─── Config ───────────────────────────────────────────────────────────────────
PMXT_API_KEY = os.environ.get("PMXT_API_KEY", "")
SIMMER_API_KEY = os.environ.get("SIMMER_API_KEY", "")
PMXT_BASE = "https://api.pmxt.dev/api"

ENTRY_THRESHOLD = float(os.environ.get("PMXT_ENTRY_THRESHOLD", "0.25"))
EXIT_THRESHOLD = float(os.environ.get("PMXT_EXIT_THRESHOLD", "0.45"))

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Using an external curl subprocess for PMXT access grants the skill an unnecessary process-spawning capability unrelated to the core trading logic. In agent environments, this broadens what the skill can do, complicates auditing, and can expose secrets or execution behavior that a standard API client would avoid.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
86% confidence
Finding

The code launches an external curl subprocess to make HTTPS requests, which adds unnecessary execution capability and increases attack surface compared with using an in-process HTTP client. While subprocess.run is invoked with an argument list rather than a shell, it still inherits a broad environment and depends on an external binary, making the skill more fragile and riskier in an automation context.

Content

Scanner excerpt · pmxt_trader.py (reported line 42)May include surrounding context.

python
return {"error": "PMXT_API_KEY not set"}
    payload = json.dumps({"args": [params or {}]})
    env = os.environ.copy()
    r = subprocess.run(
        ["curl", "-s", "--max-time", "10",
         f"{PMXT_BASE}/{exchange}/{method}",
         "-X", "POST",

Tainted flow: 'PMXT_API_KEY' from os.environ.get (line 21, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · pmxt_trader.py (reported line 42)May include surrounding context.

python
return {"error": "PMXT_API_KEY not set"}
    payload = json.dumps({"args": [params or {}]})
    env = os.environ.copy()
    r = subprocess.run(
        ["curl", "-s", "--max-time", "10",
         f"{PMXT_BASE}/{exchange}/{method}",
         "-X", "POST",

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill performs client.auto_redeem() as part of its normal run, which is a portfolio-management action beyond the stated purpose of trading on PMXT signals. Because it happens automatically and silently before trading, it can alter holdings and realized outcomes without explicit operator intent, which is risky in a financial automation skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill can both place live trades via --live and automatically redeem positions without any explicit per-action confirmation. In a financial context, state-changing operations without a final confirmation step increase the risk of accidental loss, unintended execution, or misuse when the skill is run in the wrong mode or environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.