Back to skill

Security audit

PolyEdge - Polymarket Correlation Analyzer

Security checks for vulnerabilities and agentic risk

Overview

This is a real Polymarket analyzer, but it also ships live paid API, USDC payment-verification, and dashboard code with material disclosure and security gaps.

Review this as more than a read-only analysis skill. Installing or using the local analyzer is lower risk, but running or relying on the bundled service means trusting a live paid API that handles Base USDC payments, exposes dashboard/payment data, and has payment-replay and availability weaknesses. Use a dedicated low-balance wallet if testing paid flows, avoid production credentials, and do not expose the dashboard publicly without authentication, caching, rate limits, and fixed payment-consumption logic.

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

T09 · Insecure Skill Coding Practices

Error
Location
src/x402.py:25
Finding

Reusable and Unbound Payment Proofs Allow Payment Bypass

Content
View full analysis
timestamp) # In production, use Redis or similar VERIFIED_PAYMENTS: Dict[str, float] = {} PAYMENT_TTL = 60 # 1 minute - payment valid for multiple requests ``` ```python def verify_payment(tx_hash: str) -> Tuple[bool, str]: """ Verify a payment transaction on Base. Returns (success, message). """ if not tx_hash: return False, "No transaction hash provided" # Clean the hash tx_hash = tx_hash.strip().lower() if not tx_hash.startswith("0x"): tx_hash = "0x" + tx_hash # Check cache first if tx_hash in VERIFIED_PAYMENTS: cached_time = VERIFIED_PAYMENTS[tx_hash] if time.time() - cached_time < PAYMENT_TTL: return True, "Payment verified (cached)" else: # Expired, remove from cache del VERIFIED_PAYMENTS[tx_hash] # Fetch transaction receipt from Base RPC try: receipt = fetch_tx_receipt(tx_hash) if not receipt: return False, "Transaction not found" # Check if successful if receipt.get("status") != "0x1": return False, "Transaction failed" # Parse logs for USDC transfer transfer_valid = verify_usdc_transfer(receipt.get("logs", [])) if not transfer_valid: return False, "No valid USDC transfer to payment address found" # Cache successful verification VERIFIED_PAYMENTS[tx_hash] = time.time() return True, "Payment verified" except Exception as e: return False, f"Verification error: {str(e)}" ``` ### Technical Analysis The transaction hash acts as a bearer authorization token, but it is not bound to the requester, a particular ...[truncated 1759 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/dashboard.py:39
Finding

Unauthenticated Dashboard Enables Third-Party Request Amplification

Content
View full analysis
float: """Get USDC balance from BaseScan API.""" try: url = f"{BASESCAN_API}?module=account&action=tokenbalance&contractaddress={USDC_CONTRACT}&address={PAYMENT_WALLET}&tag=latest" if BASESCAN_KEY: url += f"&apikey={BASESCAN_KEY}" req = Request(url, headers={"User-Agent": "PolymarketAPI/1.0"}) with urlopen(req, timeout=10) as resp: data = json.loads(resp.read().decode()) if data.get("status") == "1": # USDC has 6 decimals balance = int(data.get("result", 0)) / 1e6 return balance except Exception as e: print(f"Balance check error: {e}") return 0.0 def get_recent_transactions(limit: int = 10) -> List[Dict[str, Any]]: """Get recent USDC transfers to the wallet.""" try: url = f"{BASESCAN_API}?module=account&action=tokentx&contractaddress={USDC_CONTRACT}&address={PAYMENT_WALLET}&sort=desc&page=1&offset={limit}" if BASESCAN_KEY: url += f"&apikey={BASESCAN_KEY}" req = Request(url, headers={"User-Agent": "PolymarketAPI/1.0"}) with urlopen(req, timeout=10) as resp: data = json.loads(resp.read().decode()) if data.get("status") == "1": txs = [] for tx in data.get("result", []): # Only show incoming transactions ...[truncated 2476 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
src/api.py:157
Finding

Raw Internal Exception Details Are Disclosed to Remote Clients

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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (31)

Tainted flow: 'req' from os.environ.get (line 65, 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 · src/dashboard.py (reported line 47)May include surrounding context.

python
url += f"&apikey={BASESCAN_KEY}"
        
        req = Request(url, headers={"User-Agent": "PolymarketAPI/1.0"})
        with urlopen(req, timeout=10) as resp:
            data = json.loads(resp.read().decode())
            if data.get("status") == "1":
                # USDC has 6 decimals

Tainted flow: 'req' from os.environ.get (line 65, 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 · src/dashboard.py (reported line 66)May include surrounding context.

python
url += f"&apikey={BASESCAN_KEY}"
        
        req = Request(url, headers={"User-Agent": "PolymarketAPI/1.0"})
        with urlopen(req, timeout=10) as resp:
            data = json.loads(resp.read().decode())
            if data.get("status") == "1":
                # USDC has 6 decimals

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · PLAN.md (reported line 154)May include surrounding context.

md
### Skill Publishing Security

- [ ] **No credential access** — Skill doesn't read user's .env or configs
- [ ] **Declared permissions** — Clear about what it accesses
- [ ] **Open source** — All code visible for audit
- [ ] **Minimal dependencies** — Only what's necessary

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Blockchain payment verification, transfer-log inspection, RPC access, and payment-authorization header handling are sensitive financial features not disclosed by the skill’s primary description. In context, this makes the skill more dangerous because it invites use as a market-analysis tool while quietly introducing payment-processing and external-chain dependencies that can affect cost, privacy, and security.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Blockchain payment verification, transfer-log inspection, RPC access, and payment-authorization header handling are sensitive financial features not disclosed by the skill’s primary description. In context, this makes the skill more dangerous because it invites use as a market-analysis tool while quietly introducing payment-processing and external-chain dependencies that can affect cost, privacy, and security.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Blockchain payment verification, transfer-log inspection, RPC access, and payment-authorization header handling are sensitive financial features not disclosed by the skill’s primary description. In context, this makes the skill more dangerous because it invites use as a market-analysis tool while quietly introducing payment-processing and external-chain dependencies that can affect cost, privacy, and security.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Blockchain payment verification, transfer-log inspection, RPC access, and payment-authorization header handling are sensitive financial features not disclosed by the skill’s primary description. In context, this makes the skill more dangerous because it invites use as a market-analysis tool while quietly introducing payment-processing and external-chain dependencies that can affect cost, privacy, and security.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Blockchain payment verification, transfer-log inspection, RPC access, and payment-authorization header handling are sensitive financial features not disclosed by the skill’s primary description. In context, this makes the skill more dangerous because it invites use as a market-analysis tool while quietly introducing payment-processing and external-chain dependencies that can affect cost, privacy, and security.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module implements wallet/payment monitoring and revenue tracking that is unrelated to the stated skill purpose of finding Polymarket market correlations. In an agent-skill ecosystem, this kind of capability mismatch is dangerous because it expands the trust boundary, introduces financial-data collection, and may conceal monetization or tracking behavior users did not intend to authorize.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This file implements an x402 payment-gating and on-chain verification mechanism, which is materially unrelated to the declared skill purpose of detecting Polymarket market correlations. In an agent skill context, capability mismatch is dangerous because it introduces undisclosed financial logic and external dependencies that may charge for access, alter execution flow, or create hidden monetization behavior the operator did not expect.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code makes outbound RPC calls to Base endpoints to verify user-supplied transaction hashes, functionality unrelated to correlation-arbitrage analysis. In an agent environment, undisclosed network egress to third-party blockchain providers increases attack surface, leaks user activity metadata, and can be used to enforce unauthorized payment gates or create hidden dependencies that impair safe operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The plan explicitly calls for live mainnet testing with real funds ('Fund test wallet with $1 USDC' and 'Run 20 test calls') but does not include any warning about irreversible financial loss, wallet compromise risk, or safe operational limits. In a financial/payment skill context, encouraging real-money testing without prominent safeguards can lead users or agents to incur unexpected losses or expose production wallets before the system is fully validated.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill advertises networked/live API behavior and likely environment-dependent operation, but it declares no explicit tool scope or permissions. In agent environments, missing scope declarations can cause reviewers or orchestrators to underestimate what the skill can access, increasing the chance of unintended network calls or environment-variable exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation advertises a live paid API with per-query USDC charges but does not present a strong, prominent warning that real funds will be spent. In agent contexts, ambiguous pricing language can lead to unintended automated payments, especially if a caller treats the endpoint like an ordinary read-only API.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

The skill sends data to an external API endpoint, which creates exfiltration and dependency risk even if the destination is legitimate. In this case the transmitted market slugs, request metadata, and potentially payment-related context leave the local environment and are subject to third-party handling.

Content

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

x402-enabled API endpoint for pay-per-query access.

text
GET https://api.nshrt.com/api/v1/correlation?a=<slug>&b=<slug>

Pricing: $0.05 USDC on Base L2

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

Linking to and likely interacting with an external dashboard introduces additional third-party exposure and may reveal operational or financial metadata to users or services outside the local environment. While not inherently malicious, it broadens the trust boundary beyond a simple analysis skill.

Content

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

md
3. Retry with `X-Payment: <tx_hash>` header
4. Get analysis

**Dashboard:** https://api.nshrt.com/dashboard

## Author

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes a skill for detecting mispriced correlations between Polymarket markets, but this file implements a full HTTP product surface with x402 payment handling and dashboard endpoints. Serving monetized API access and activity dashboards is not an obvious implementation detail of a correlation-analysis skill as described in the manifest.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Returning raw exception text to API callers can leak internal implementation details, dependency behavior, filesystem paths, network errors, or validation gaps that help an attacker refine probes and target downstream components. In an internet-exposed service, especially one advertising paid endpoints, this increases reconnaissance value and can expose operational details not meant for clients.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Reading wallet configuration and querying on-chain payment history is not justified by the advertised arbitrage-analysis functionality. Even if the wallet is a service wallet, this introduces unnecessary financial-data access and external lookups, which become more suspicious and risky because they are out of scope for the declared skill behavior.

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 · src/dashboard.py (reported line 16)May include surrounding context.

python
# Configuration
PAYMENT_WALLET = os.environ.get("PAYMENT_WALLET", "0xB8B984d8150571D2Dd19aF2400D52332E262c945")
USDC_CONTRACT = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"  # USDC on Base
BASESCAN_API = "https://api.basescan.org/api"
BASESCAN_KEY = os.environ.get("BASESCAN_API_KEY", "")  # Optional, rate limited without

# In-memory stats (resets on restart - could persist to file/db)

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 · src/dashboard.py (reported line 116)May include surrounding context.

python
"recent_payments": recent_txs,
        "links": {
            "explorer": f"https://basescan.org/address/{PAYMENT_WALLET}",
            "api_docs": "https://api.nshrt.com/",
        }
    }

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a skill for detecting mispriced correlations between Polymarket prediction markets, but this file renders a dashboard for paid API operations, including balance, paid requests, session revenue, recent payments, and a payment wallet. Those monetization and wallet-display behaviors are not an obvious implementation detail of cross-market arbitrage detection.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This file formats recent blockchain payments with transaction hashes and sender addresses, and later exposes a payment wallet and block explorer link. A Polymarket correlation finder may need market data access, but payment collection and wallet presentation are separate business capabilities not justified by the manifest's stated purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The HTML is built with direct string interpolation of externally sourced fields such as transaction hash, sender, timestamp, and amount, without HTML escaping. If any upstream data source can be influenced by an attacker, this can lead to stored or reflected XSS in the dashboard, allowing script execution in viewers' browsers and possible session or admin-interface compromise.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code pulls wallet, price, and RPC settings from environment variables despite the skill being described as an arbitrage finder. In a mismatched skill, environment-driven payment configuration is risky because it enables hidden runtime behavior changes, including redirecting payments to attacker-controlled wallets or changing external infrastructure without visibility to users.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.