Back to skill

Security audit

Polymarket Optimizer

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Polymarket optimizer, but it needs review because it can automatically change trading settings, use broad credentials, run persistently, and send financial reports to Telegram.

Install only if you are comfortable with unattended changes to trading configuration and optional Telegram reports containing portfolio and strategy data. Use a dedicated minimal environment file, verify the Telegram chat ID, avoid the root systemd setup, keep backups of learned_config.json, and prefer a scheduler running with the least privilege needed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SYSTEMD_SETUP.md:27
Finding

Persistent Scheduled Execution Runs with Host Root and Docker-Equivalent Privileges

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:12
Finding

Security Metadata Understates Credential Use and Outbound Financial Telemetry

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (36)

Tainted flow: 'req' from os.environ.get (line 117, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · polymarket_optimizer.py (reported line 118)May include surrounding context.

python
"parse_mode": "HTML"
        }).encode()
        req = urllib.request.Request(url, data, {"Content-Type": "application/json"})
        urllib.request.urlopen(req, timeout=10)
    except Exception as e:
        print(f"[TELEGRAM] Error: {e}")

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The top-level description understates the skill's real behavior: it not only optimizes parameters but also reads additional trading data, writes persistent logs, and transmits reports externally via Telegram. This mismatch is dangerous because users and orchestrators may approve or schedule the skill based on incomplete understanding, leading to silent data egress and autonomous behavioral changes in a trading system.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The documentation tells operators to load credentials from a shared .env file into a root-run service context. That can overexpose secrets to the service, any child processes, and potentially to logs or debugging interfaces, especially since the command then crosses a host-to-container boundary.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 45)May include surrounding context.

md
User=root
WorkingDirectory=/docker/openclaw-yyvg

# Load credentials from Wesley's .env
EnvironmentFile=/docker/openclaw-yyvg/.env

# Run inside OpenClaw Docker container

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Using EnvironmentFile to inject a broad .env into a privileged scheduled service creates unnecessary credential exposure and increases impact if the scheduled task or container invocation is abused. In this trading-automation context, leaked API keys or tokens could directly affect financial accounts and infrastructure.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 46)May include surrounding context.

md
WorkingDirectory=/docker/openclaw-yyvg

# Load credentials from Wesley's .env
EnvironmentFile=/docker/openclaw-yyvg/.env

# Run inside OpenClaw Docker container
ExecStart=/usr/bin/docker exec openclaw-yyvg-openclaw-1 \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown states that the skill runs automatically, reads performance data, and adjusts trading parameters with no manual configuration needed after setup. It does not include any caution that the skill writes learned_config.json and changes trading behavior automatically, which could affect user data and system behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill exposes capabilities to read environment variables, read and write local files, and make network requests, but it does not declare a restrictive tool scope such as explicit permissions or allowed-tools. This creates an under-specified trust boundary where operators may assume narrower behavior than the skill actually requires, increasing the risk of unintended access or abuse if the implementation changes or is swapped.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The skill is explicitly configured to make outbound requests to the Telegram Bot API, which is an external transmission channel for trading-related data. In this context the behavior appears intended rather than covert, but it still expands the attack surface and can leak sensitive portfolio or strategy information if enabled or misconfigured.

Content

Scanner excerpt · SKILL.md (reported line 19)May include surrounding context.

md
network_behavior:
      makes_requests: true
      endpoints_allowed:
        - "https://api.telegram.org/bot*"
      requires_credentials: false
      uses_websocket: false
    security_level: "L1 - Read/Write local files only"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises 'Zero manual intervention required' while omitting a prominent warning that it will automatically rewrite learned_config.json and thereby alter future trading behavior. In an automated trading context, silent self-modification raises operational and security risk because bad inputs, poisoned metrics, or logic errors can directly change execution parameters without review.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 26)May include surrounding context.

Systemd timers are more reliable than cron for services. Use a timer + service pair.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 29)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 61)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 83)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 84)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 85)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 86)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 102)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 105)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 114)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 123)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 132)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 133)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 140)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 141)May include surrounding context.

Step 1: Create Service File

bash
sudo nano /etc/systemd/system/polymarket-optimizer.service

Paste:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The service definition explicitly runs as root and loads a shared .env credential file into the service environment. This increases blast radius if the optimizer or container execution path is compromised, and can expose sensitive values through process environments, logs, or overly broad host/container access.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SYSTEMD_SETUP.md (reported line 84)May include surrounding context.

bash
sudo systemctl daemon-reload
sudo systemctl enable polymarket-optimizer.timer
sudo systemctl start polymarket-optimizer.timer
sudo systemctl status polymarket-optimizer.timer

Static analysis

No suspicious patterns detected.