Back to skill

Security audit

Polygon Agents CLI

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Polygon wallet-agent purpose, but it asks the agent to run mutable remote executables and handle wallet credentials in ways that need careful review.

Install only if you are comfortable with an agent-assisted wallet tool handling project keys and session authority. Prefer pinning and verifying the CLI and cloudflared versions, avoid global installs, run it in a constrained environment, use low session spend limits and recipient/contract allowlists, inspect every recipient and amount before using --broadcast, and rotate or remove stored sessions, keys, and /tmp session blobs when done.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T08 · Insecure Dependencies

Error
Location
SKILL.md:10
Finding

Unpinned Remote npm Package Is Installed and Executed

Content
View full analysis
` - Storage: `~/.polygon-agent/` (AES-256-GCM encrypted) ``` The quick-start guide additionally recommends a global installation: ```markdown ## Prerequisites - Node.js 22+ - Run via npx: `npx @polygonlabs/agent-cli ` - Or install globally for the shorter `polygon-agent` command: `npm install -g @polygonlabs/agent-cli` ``` ### Technical Analysis The documentation instructs the Agent to retrieve and execute `@polygonlabs/agent-cli` without pinning an exact package version or integrity digest. Depending on local npm behavior and cache state, `npx` can download the current registry release and execute it immediately. Consequently, the effective executable can change after the Skill has been reviewed. A compromised npm account, package registry, maintainer environment, or future malicious release could introduce arbitrary code without any modification to this Skill. Global installation further expands the exposure because the package remains available to later shell sessions. This risk is particularly significant because the package is expected to operate in a context containing wallet credentials, project access keys, encrypted wallet sessions, and authority to broadcast financial transactions. ### Attack Path 1. An attacker compromises the package publisher, publication pipeline, or registry entry for `@polygonlabs/agent-cli`. 2. The attacker publishes a modified release containing malicious install-time or runtime behavior. 3. The Agent follows the Skill and invokes `npx @polygonlabs/agent-cli` or installs the package globally without specifying an audited version. 4. npm retrieves and executes the attacker-cont ...[truncated 905 chars]
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:157
Finding

Automatic Download and Execution of an Unverified Cloudflared Binary

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:15
Finding

Raw Project Access Key Is Loaded into Agent Context and Replicated Across Environment Variables

Content
View full analysis
export SEQUENCE_INDEXER_ACCESS_KEY=$SEQUENCE_PROJECT_ACCESS_KEY export TRAILS_API_KEY=$SEQUENCE_PROJECT_ACCESS_KEY ``` - **If it doesn't exist** — the user hasn't completed setup yet. Proceed to Phase 1 (`setup`) which will create the file. ``` ### Technical Analysis The Skill explicitly directs a general-purpose Agent to read `~/.polygon-agent/builder.json`, extract an access credential, and place the same credential into three environment variables. Wallet operations legitimately require authentication, but exposing the raw key to the Agent is broader than necessary. A safer architecture would have trusted wallet software retrieve the credential internally from a protected store. Once loaded into Agent context or shell environment, the credential may become available to: - Child processes inheriting the environment - Debugging and diagnostic tools - Error reports or command transcripts - Prompt-injected tool calls - Untrusted dependencies executed in the same process context Reusing one key under three service-specific variable names also enlarges the credential's effective trust boundary. A compromise of any process expecting one of those variables may expose access used for the other services. The project claims that storage is protected with AES-256-GCM, but no implementation is present to verify key management, decryption behavior, access-key scope, or file permissions. Reading the stored key ...[truncated 1271 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (15)

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

The skill explicitly promotes a session-based autonomous-agent workflow that can create wallets, persist credentials, and perform token operations. In this context, session persistence expands the blast radius of compromise: if the host, encrypted storage, exported environment variables, callback blob, or active session is exposed, an attacker may gain ongoing ability to transact within the session's permissions.

Content

Scanner excerpt · QUICKSTART.md (reported line 3)May include surrounding context.

md
---
name: polygon-agent-cli-quickstart
description: Quick start guide for Polygon Agent CLI. Get project access key, create wallet with session permissions, register agent onchain, perform token operations. Context-efficient workflow for autonomous agents.
---

# Polygon Agent CLI - Quick Start

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

The quickstart instructs users to run the CLI via npx @polygonlabs/agent-cli without pinning an exact version. That causes the latest published package to be fetched and executed at runtime, which increases supply-chain risk: a compromised maintainer account, malicious update, or typo/squat replacement could result in arbitrary code execution on the user's machine.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · QUICKSTART.md (reported line 194)May include surrounding context.

md
## Error Recovery

| Issue                            | Fix                                                                                                         |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| Session expired                  | Re-run `wallet create`                                                                                      |
| Insufficient funds               | Fund wallet address with POL                                                                                |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · QUICKSTART.md (reported line 196)May include surrounding context.

md
| Issue                            | Fix                                                                                                         |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| Session expired                  | Re-run `wallet create`                                                                                      |
| Insufficient funds               | Fund wallet address with POL                                                                                |
| Fee errors                       | Set `POLYGON_AGENT_DEBUG_FEE=1` to inspect                                                                  |
| Tx failed                        | Omit `--broadcast` for dry-run first                                                                        |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · QUICKSTART.md (reported line 197)May include surrounding context.

md
| Issue                            | Fix                                                                                                         |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| Session expired                  | Re-run `wallet create`                                                                                      |
| Insufficient funds               | Fund wallet address with POL                                                                                |
| Fee errors                       | Set `POLYGON_AGENT_DEBUG_FEE=1` to inspect                                                                  |
| Tx failed                        | Omit `--broadcast` for dry-run first                                                                        |
| Callback timeout                 | `--timeout 600`                                                                                             |

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The skill instructs users to run the CLI via npx @polygonlabs/agent-cli without pinning an exact package version. That creates a supply-chain risk because future package updates, compromised maintainer accounts, or a typosquatted/transitively altered release could change behavior at execution time and lead to arbitrary code execution on the user's machine.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly tells the operator to extract an accessKey from local storage and export it as plaintext environment variables, but gives no warning about credential sensitivity, shell history leakage, process-list exposure in some environments, accidental logging, or inheritance into child processes. Because the same key is reused for multiple services, compromise of that one value could enable unauthorized wallet/indexer/Trails operations within the project scope.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 · SKILL.md (reported line 139)May include surrounding context.

md
## Key Behaviors

- **Dry-run by default** — all write commands require `--broadcast` to execute
- **Smart defaults** — `--wallet main`, `--chain polygon`, auto-wait on `wallet create`
- **Fee preference** — auto-selects USDC over native POL when both available
- **`fund`** — reads `walletAddress` from the wallet session and sets it as `toAddress` in the Trails widget URL. Always run `polygon-agent fund` to get the correct URL — never construct it manually or hardcode any address. The returned JSON contains `fundingUrl` and `walletAddress` so you can confirm the pre-filled recipient before sharing.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
## Troubleshooting

| Issue                                 | Fix                                                                                                                             |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `Builder configured already`          | Add `--force`                                                                                                                   |
| `Missing SEQUENCE_PROJECT_ACCESS_KEY` | Run `setup` first                                                                                                               |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
| Issue                                 | Fix                                                                                                                             |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `Builder configured already`          | Add `--force`                                                                                                                   |
| `Missing SEQUENCE_PROJECT_ACCESS_KEY` | Run `setup` first                                                                                                               |
| `Missing wallet`                      | `wallet list`, re-run `wallet create`                                                                                           |
| `Session expired`                     | Re-run `wallet create` (24h expiry)                                                                                             |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
| Issue                                 | Fix                                                                                                                             |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `Builder configured already`          | Add `--force`                                                                                                                   |
| `Missing SEQUENCE_PROJECT_ACCESS_KEY` | Run `setup` first                                                                                                               |
| `Missing wallet`                      | `wallet list`, re-run `wallet create`                                                                                           |
| `Session expired`                     | Re-run `wallet create` (24h expiry)                                                                                             |
| `Fee option errors`                   | Set `POLYGON_AGENT_DEBUG_FEE=1`, ensure wallet has funds                                                                        |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `Builder configured already`          | Add `--force`                                                                                                                   |
| `Missing SEQUENCE_PROJECT_ACCESS_KEY` | Run `setup` first                                                                                                               |
| `Missing wallet`                      | `wallet list`, re-run `wallet create`                                                                                           |
| `Session expired`                     | Re-run `wallet create` (24h expiry)                                                                                             |
| `Fee option errors`                   | Set `POLYGON_AGENT_DEBUG_FEE=1`, ensure wallet has funds                                                                        |
| `Timed out waiting for callback`      | Add `--timeout 600`                                                                                                             |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · QUICKSTART.md (reported line 200)May include surrounding context.

md
| `Builder configured already`          | Add `--force`                                                                                                                   |
| `Missing SEQUENCE_PROJECT_ACCESS_KEY` | Run `setup` first                                                                                                               |
| `Missing wallet`                      | `wallet list`, re-run `wallet create`                                                                                           |
| `Session expired`                     | Re-run `wallet create` (24h expiry)                                                                                             |
| `Fee option errors`                   | Set `POLYGON_AGENT_DEBUG_FEE=1`, ensure wallet has funds                                                                        |
| `Timed out waiting for callback`      | Add `--timeout 600`                                                                                                             |
| `callbackMode: manual` (no tunnel)    | cloudflared unavailable — paste blob from browser when prompted; blob saved to `/tmp/polygon-session-<rid>.txt`                 |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
| `Builder configured already`          | Add `--force`                                                                                                                   |
| `Missing SEQUENCE_PROJECT_ACCESS_KEY` | Run `setup` first                                                                                                               |
| `Missing wallet`                      | `wallet list`, re-run `wallet create`                                                                                           |
| `Session expired`                     | Re-run `wallet create` (24h expiry)                                                                                             |
| `Fee option errors`                   | Set `POLYGON_AGENT_DEBUG_FEE=1`, ensure wallet has funds                                                                        |
| `Timed out waiting for callback`      | Add `--timeout 600`                                                                                                             |
| `callbackMode: manual` (no tunnel)    | cloudflared unavailable — paste blob from browser when prompted; blob saved to `/tmp/polygon-session-<rid>.txt`                 |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
| `Missing wallet`                      | `wallet list`, re-run `wallet create`                                                                                           |
| `Session expired`                     | Re-run `wallet create` (24h expiry)                                                                                             |
| `Fee option errors`                   | Set `POLYGON_AGENT_DEBUG_FEE=1`, ensure wallet has funds                                                                        |
| `Timed out waiting for callback`      | Add `--timeout 600`                                                                                                             |
| `callbackMode: manual` (no tunnel)    | cloudflared unavailable — paste blob from browser when prompted; blob saved to `/tmp/polygon-session-<rid>.txt`                 |
| `404` on `*.trycloudflare.com`        | CLI timed out and tunnel is gone — re-run `wallet create`, open the new `approvalUrl` immediately                               |
| `"Auto-send failed"` in browser       | Copy the ciphertext shown below that message; run `wallet import --ciphertext '<blob>'`                                         |