Back to skill

Security audit

Polymarket Smart Money

Security checks for vulnerabilities and agentic risk

Overview

The skill’s Polymarket analysis purpose is clear, but it asks the agent to run unaudited code from a neighboring project directory and virtual environment outside the reviewed skill package.

Review before installing. Only use this skill if you control and trust the referenced PolyAnalysis directory and its .venv, because the reviewed package does not include the Python code it tells the agent to execute. Keep any Polygon RPC key in .env least-privileged, and invoke the skill only for explicit Polymarket wallet analysis or discovery tasks.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:11
Finding
Execution of Unbundled Code Outside the Skill Trust Boundary<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 11-26 **Vulnerability Type**: External unverified code execution through a mutable relative path **Risk Level**: Medium ### Vulnerable Code ```markdown ## Project Location ``` {baseDir}/../../agents/polymarket-bot/PolyAnalysis/ ``` Activate the virtualenv before running any script: ```bash cd {baseDir}/../../agents/polymarket-bot/PolyAnalysis source .venv/bin/activate ``` ## Quick Commands ### Analyze a single wallet ```bash python analyze.py <address> ``` ``` ### Technical Analysis The skill directs the agent to traverse outside the audited project directory, activate an external Python virtual environment, and execute an external `analyze.py` script. Neither that script nor the virtual environment and its installed dependencies are included in the audited artifact. Consequently, the effective executable behavior cannot be established from the reviewed skill package. The relative traversal through `../../agents/` also makes execution dependent on mutable files outside the skill's trust boundary. Activating `.venv` modifies shell environment variables, including `PATH`, before invoking `python`, so both the interpreter and the target script originate from the unaudited external directory. This is an insecure trust-boundary design rather than evidence that the external code is currently malicious. Exploitation requires an attacker to gain write access to the referenced directory, virtual environment, or a path component used to resolve it. ### Attack Path 1. An attacker obtains the ability to create or modify files under the externally referenced `agents/polymarket-bot/PolyAnalysis` directory. 2. The attacker replaces `analyze.py`, modifies the virtual environment's Python interpreter or activation script, or introduces a malicious imported module. 3. A user asks the agent to analyze a wallet or run the discovery workflow. 4. Following `SKILL.md`, the agent changes into the ex ...[truncated 905 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Bundle `analyze.py` and all required application modules inside the skill package so that the reviewed artifact contains the complete executable behavior. 2. Include a locked dependency manifest with exact versions and cryptographic hashes, and install dependencies from an explicitly trusted package source. 3. Avoid sourcing an externally managed virtual environment. Invoke a verified interpreter through an absolute, canonical path instead. 4. Resolve the execution directory to its canonical path and verify that it remains within an approved skill-owned directory before running code. 5. Reject symbolic links, unexpected ownership, or writable path components that could redirect execution to attacker-controlled content. 6. Verify packaged scripts and runtime components against signed manifests or trusted checksums before execution. 7. Run the analysis process in a sandbox with minimal filesystem access, restricted environment variables, no unnecessary credentials, and network access limited to the documented Polymarket and RPC endpoints. 8. Document all required external resources and credential access so operators can apply least-privilege controls. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (3)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger list is broad and includes generic phrases like 'analyze wallet', 'leaderboard', and 'copy trading', plus multilingual variants, which can cause the skill to activate for loosely related financial or crypto requests. Over-broad activation increases the chance the agent invokes this skill in the wrong context, leading to unintended execution of local scripts and unnecessary access to adjacent project resources.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The instruction to 'Use Chinese for user-facing output' overrides user language preference without explicit consent. While not a direct code-execution issue, it can cause misleading or inaccessible responses, especially in financial analysis contexts where clarity and user comprehension are important for safe decision-making.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
This markdown file presents all explanatory content in Chinese and does not indicate any user choice, alternative locale, or opt-in for language preference. Under the policy for natural-language violations, forcing a specific language without user opt-in is reportable unless the locale constraint is clearly documented and justified.

Static analysis

No suspicious patterns detected.