Back to skill

Security audit

exploring-solana-with-solscan

Security checks for vulnerabilities and agentic risk

Overview

This skill is a read-only Solscan Pro API helper whose network and API-key use match its stated blockchain lookup purpose, with privacy and reliability notes users should understand.

Install only if you are comfortable sending Solana lookup targets and your Solscan API key to Solscan Pro. Treat wallet addresses, transaction signatures, and investigation filters as potentially sensitive metadata, and be aware that requests may hang because the CLI does not set an HTTP timeout.

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

Note
Location
scripts/solscan.py:28
Finding

Unbounded HTTP Request Can Cause Indefinite Process Blocking

Content
View full analysis

Vulnerability Details

File Location: scripts/solscan.py:28
Vulnerability Type: Missing HTTP connection and read timeout
Risk Level: Low

Vulnerable Code

python
try:
    response = requests.get(url, headers=headers, params=params)
    response.raise_for_status()
    return response.json()
except requests.exceptions.RequestException as e:
    print(f"API Request Error: {e}", file=sys.stderr)
    if hasattr(e, 'response') and e.response is not None:
         print(f"Response Body: {e.response.text}", file=sys.stderr)
    sys.exit(1)

Technical Analysis

The requests.get() call does not specify a timeout. The Requests library therefore permits the operation to wait indefinitely if the remote endpoint or a network intermediary accepts the connection but fails to complete the response.

Because every command routes through make_request(), the issue affects all account, token, transaction, NFT, block, market, program, and API-usage queries.

Attack Path

  1. A user or agent invokes any supported Solscan command.
  2. make_request() sends an HTTPS GET request to the fixed Solscan API endpoint.
  3. The endpoint or an intervening network component accepts the request but delays or withholds response data.
  4. With no connection or read timeout, the process remains blocked indefinitely.
  5. Repeated blocked invocations may consume available worker capacity and degrade service availability.

Exploitation requires influence over the remote service or relevant network path. The destination is fixed in the code, so ordinary command-line input cannot redirect the request to an attacker-controlled host.

Impact Assessment

The impact is limited to availability. An affected process can hang, delay task completion, and consume an execution worker. Concurrent stalled calls may cause resource exhaustion.

The flaw does not grant additional system privileges, enable arbitrary code execution, expose local files, or redirect the API key to anot ...[truncated 117 chars]

Remediation
View remediation

Remediation Suggestions

Set explicit connection and read timeouts:

python
response = requests.get(
    url,
    headers=headers,
    params=params,
    timeout=(5, 30),
)

Handle timeout failures separately so callers receive a clear error:

python
except requests.exceptions.Timeout:
    print("API Request Error: Solscan request timed out.", file=sys.stderr)
    sys.exit(1)

For transient failures, consider a requests.Session configured with a small, bounded retry count and exponential backoff. Retries should apply only to safe transient conditions and must preserve an overall execution deadline.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Tainted flow: 'headers' from os.environ.get (line 18, credential/environment) → requests.get (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 · scripts/solscan.py (reported line 28)May include surrounding context.

python
params = {k: v for k, v in params.items() if v is not None}
        
    try:
        response = requests.get(url, headers=headers, params=params)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
**Syntax**: `python3 scripts/solscan.py <resource> <action> [--param value]`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents executable interfaces that use network access and an API key, but it does not declare any explicit tool scope such as allowed-tools or permissions. That increases the chance an agent runtime grants broader capabilities than intended or allows this skill to make external requests without transparent governance, which is a real security-control gap.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill sends wallet addresses, transaction signatures, and other query data to a third-party API but does not warn users that their inputs will leave the local environment. In a blockchain-analysis context, these identifiers can still be sensitive for privacy, attribution, or investigative workflows, so omission of a disclosure meaningfully increases privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Wallet addresses, transaction signatures, token/account filters, and other user-supplied blockchain investigation parameters are sent to the Solscan third-party API without any explicit disclosure, consent checkpoint, or minimization. While blockchain data is often public, query intent and investigation targets can still be sensitive metadata in an agent context and may leak user interests, monitoring targets, or operational investigations to the provider.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script exposes capabilities beyond the skill metadata, including market and program operations not clearly disclosed in the manifest. In an agent-skill setting, this creates a trust boundary problem: the orchestrator or user may authorize a narrower data-access tool while the code can perform broader third-party queries than expected.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The token reference marks token price as deprecated historical price lookup and directs users to token price-history or token price-latest (L179-L182, L195-L211). However, the workflow step says token price --address <MINT> → get current price, which conflicts with the documented intent of the commands.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The API reference documents transaction actions as taking --tx (L298-L302), but the evaluation says the skill calls transaction actions --signature XYZ. This is an active contradiction in the documentation that could cause an agent to invoke the tool incorrectly.

Content

No source excerpt is available for this finding.