Back to skill

Security audit

x402-layer

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marked this skill suspicious because it reports serious risks around wallet signing and spending, an unverified remote install command, and capabilities beyond the declared purpose; several parts were only partially inspected.

Treat this as a high-risk install and do not use it with a funded wallet or valuable credentials unless the reported transaction, payment, installation, and file-handling risks have been independently reviewed and addressed. The scan was partial: three components were not fully inspected, including references limited by output caps and an opaque XMTP script.

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
scripts/pay_base.py
Finding

Remote payment challenges determine spending without an enforceable authorization limit

Content
View full analysis

Impact

An endpoint can obtain an authorization exceeding the intended purchase price and redeem it against available USDC. The AgentKit auto path also accepts a higher replacement price while describing the continuation as the normal price.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/agentkit_support.py
Finding

AgentKit signs authentication messages for arbitrary remote domains

Content
View full analysis

Impact

The malicious endpoint obtains a valid wallet signature asserting sign-in to an unrelated service. If that service accepts the relayed live challenge, the attacker can authenticate as the victim wallet there. This is conditional on the target service's challenge and session rules; unconditional account takeover is not established.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/solana_signing.py
Finding

Solana USDC payment signing permits substitution of another token mint

Content
View full analysis

Impact

The endpoint can receive a signed transfer of a non-USDC token. With sufficient token balance, an existing destination token account, and the required fee-payer signature or funding, the transaction can transfer that asset to the attacker. Tokens with incompatible decimals are not covered by this demonstrated path.

Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (145)

Tainted flow: 'wallet' from os.getenv (line 38, 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/check_credits.py (reported line 44)May include surrounding context.

python
print(f"Checking credits for: {endpoint_slug}")
    print(f"Wallet: {wallet}")

    response = requests.get(
        url,
        params={"action": "balance", "wallet": wallet},
        headers={"Accept": "application/json"},

Tainted flow: 'url' from os.getenv (line 64, credential/environment) → requests.post (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/erc8004_wallet_client.py (reported line 29)May include surrounding context.

python
headers: Optional[Dict[str, str]] = None,
    timeout: int = 60,
) -> Dict[str, Any]:
    response = requests.post(url, json=body, headers=headers or {}, timeout=timeout)
    try:
        data = response.json()
    except Exception:

Tainted flow: 'headers' from os.getenv (line 51, credential/environment) → requests.post (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/list_on_marketplace.py (reported line 80)May include surrounding context.

python
if banner_url:
        print(f"  Banner: {banner_url}")

    response = requests.post(url, json=data, headers=headers)

    if response.status_code in [200, 201]:
        result = response.json()

Tainted flow: 'headers' from os.getenv (line 96, credential/environment) → requests.post (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/list_on_marketplace.py (reported line 104)May include surrounding context.

python
print(f"Unlisting endpoint: {slug} from marketplace...")

    response = requests.post(url, json=data, headers=headers)

    if response.status_code == 200:
        result = response.json()

Tainted flow: 'api_key' from os.getenv (line 233, 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/manage_endpoint.py (reported line 45)May include surrounding context.

python
def get_endpoint_info(slug: str, api_key: Optional[str] = None) -> dict:
    response = requests.get(
        f"{API_BASE}/agent/endpoints",
        params={"slug": slug},
        headers=_build_headers(api_key),

Tainted flow: 'endpoint_id' from os.getenv (line 88, 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/manage_endpoint.py (reported line 99)May include surrounding context.

python
"details": details,
        }

    response = requests.get(
        f"{API_BASE}/agent/endpoints",
        params={"action": "stats", "endpoint_ids": endpoint_id},
        headers={"Accept": "application/json"},

Tainted flow: 'api_key' from os.getenv (line 161, credential/environment) → requests.patch (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/manage_endpoint.py (reported line 165)May include surrounding context.

python
if not api_key:
        return {"error": "Update requires X_API_KEY or API_KEY"}

    response = requests.patch(
        f"{API_BASE}/agent/endpoints",
        params={"slug": slug},
        headers={**_build_headers(api_key), "Content-Type": "application/json"},

Tainted flow: 'api_key' from os.getenv (line 52, credential/environment) → requests.patch (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/manage_webhook.py (reported line 53)May include surrounding context.

python
def set_webhook(slug: str, webhook_url: str) -> dict:
    """Set or update the webhook URL for an endpoint."""
    api_key = _load_api_key()
    response = requests.patch(
        f"{API_BASE}/agent/endpoints",
        params={"slug": slug},
        json={"webhook_url": webhook_url},

Tainted flow: 'api_key' from os.getenv (line 73, credential/environment) → requests.patch (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/manage_webhook.py (reported line 74)May include surrounding context.

python
def remove_webhook(slug: str) -> dict:
    """Remove the webhook URL from an endpoint."""
    api_key = _load_api_key()
    response = requests.patch(
        f"{API_BASE}/agent/endpoints",
        params={"slug": slug},
        json={"webhook_url": None},

Tainted flow: 'api_key' from os.getenv (line 88, 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/manage_webhook.py (reported line 89)May include surrounding context.

python
def get_webhook_info(slug: str) -> dict:
    """Check if an endpoint has a webhook configured."""
    api_key = _load_api_key()
    response = requests.get(
        f"{API_BASE}/agent/endpoints",
        params={"slug": slug},
        headers={"X-API-Key": api_key, "Accept": "application/json"},

Tainted flow: 'signed_tx_base64' from os.getenv (line 226, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
98% confidence
Finding

The transmitted value is a signed transaction, not the private key, so the scanner's credential-exfiltration characterization is inaccurate. However, this helper signs the supplied transaction message without checking its instructions, allowing a malicious prepared transaction to authorize asset transfers or other wallet actions and then be broadcast.

Content

Scanner excerpt · scripts/solana_signing.py (reported line 228)May include surrounding context.

python
signed_tx = VersionedTransaction(raw_tx.message, [keypair, *(extra_signers or [])])
    signed_tx_base64 = base64.b64encode(bytes(signed_tx)).decode()

    response = requests.post(
        rpc_url,
        json={
            "jsonrpc": "2.0",

Tainted flow: 'BASE' from os.getenv (line 38, 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/stake_sgl.py (reported line 87)May include surrounding context.

python
# ─── API helpers ─────────────────────────────────────────────────────────────

def _get(path: str) -> dict:
    r = requests.get(f"{BASE}{path}", timeout=TIMEOUT)
    data = r.json()
    if not r.ok:
        sys.exit(f"GET {path} failed ({r.status_code}): {data.get('error', data)}")

Tainted flow: 'BASE' from os.getenv (line 38, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
97% confidence
Finding

The environment-derived URL is not itself a leaked secret, but this POST helper participates in a dangerous prepare-sign-submit flow: every transaction returned by the service is signed without checking its instructions against the requested staking action. A compromised preparation service or malicious endpoint override could obtain a valid transaction transferring wallet assets or granting unwanted authority; the printed warning does not constrain what is signed.

Content

Scanner excerpt · scripts/stake_sgl.py (reported line 95)May include surrounding context.

python
def _post(path: str, body: dict) -> dict:
    r = requests.post(f"{BASE}{path}", json=body, timeout=TIMEOUT)
    data = r.json()
    if not r.ok:
        msg = data.get("error", data)

Tainted flow: 'url' from os.getenv (line 44, credential/environment) → requests.post (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/submit_feedback.py (reported line 59)May include surrounding context.

python
else:
        body["agentId"] = agent_id

    response = requests.post(
        url,
        json=body,
        headers={

Tainted flow: 'STUDIO_BASE' from os.getenv (line 25, 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/support_threads.py (reported line 68)May include surrounding context.

python
def _resolve_listing(listing_type: str, listing_ref: str) -> Dict[str, str]:
    if listing_type == "endpoint" and not listing_ref.startswith("http") and len(listing_ref) < 64:
        response = requests.get(f"{STUDIO_BASE}/api/public/endpoints/{listing_ref}", timeout=30)
        if response.status_code == 200:
            data = response.json()
            return {"listing_id": data["id"], "listing_type": "endpoint", "name": data.get("name") or listing_ref}

Tainted flow: 'STUDIO_BASE' from os.getenv (line 25, 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/support_threads.py (reported line 76)May include surrounding context.

python
if listing_ref.startswith("http"):
        slug = listing_ref.rstrip("/").split("/")[-1]
        if listing_type == "endpoint":
            response = requests.get(f"{STUDIO_BASE}/api/public/endpoints/{slug}", timeout=30)
            if response.status_code == 200:
                data = response.json()
                return {"listing_id": data["id"], "listing_type": "endpoint", "name": data.get("name") or slug}

Tainted flow: 'API_BASE' from os.getenv (line 24, 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/support_threads.py (reported line 82)May include surrounding context.

python
return {"listing_id": data["id"], "listing_type": "endpoint", "name": data.get("name") or slug}

    # fallback to marketplace search by id/slug
    response = requests.get(f"{API_BASE}/api/marketplace", params={"search": listing_ref, "limit": 50}, timeout=30)
    response.raise_for_status()
    data = response.json()
    listings = data.get("listings", [])

Tainted flow: 'api_key' from os.getenv (line 48, credential/environment) → requests.put (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/topup_endpoint.py (reported line 70)May include surrounding context.

python
headers=headers,
        )

    response = requests.put(
        url,
        params=params,
        json=data,

Tainted flow: 'api_key' from os.getenv (line 48, credential/environment) → requests.put (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/topup_endpoint.py (reported line 102)May include surrounding context.

python
# From here the payment is SENT. A timeout, 202 or 5xx is pending, never a reason to pay again.
    try:
        response = requests.put(
            url,
            params=params,
            json=data,

External Script Fetching

High
Category
Supply Chain
Confidence
99% confidence
Finding

The installation command executes mutable network content without verifying a pinned artifact or its integrity. A compromised distribution server could execute arbitrary commands as the installing user, with especially serious consequences on a host holding wallet keys or payment credentials.

Content

Scanner excerpt · README.md (reported line 27)May include surrounding context.

Self-Hosted

bash
curl -fsSL https://api.x402layer.cc/skill/x402-layer/install | bash

v1.11.1 keeps the Studio webhook hardening guidance and adds direct fundraiser campaign management through owner-linked dashboard API keys alongside the PAT-backed MCP path.

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

The pipe connects an unverified remote response directly to a shell, eliminating an inspection or integrity-verification step. This is the same underlying installation vulnerability as the SC2 finding, not evidence of a separate malicious payload.

Content

Scanner excerpt · README.md (reported line 27)May include surrounding context.

Self-Hosted

bash
curl -fsSL https://api.x402layer.cc/skill/x402-layer/install | bash

v1.11.1 keeps the Studio webhook hardening guidance and adds direct fundraiser campaign management through owner-linked dashboard API keys alongside the PAT-backed MCP path.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Fundraiser campaign management is a distinct capability not disclosed in the declared description. Although the description broadly mentions managing x402 Singularity Layer operations, its specified functions concern API monetization, agent infrastructure, and staking rather than fundraising. The authentication and service domain are consistent with the declared ecosystem; the mismatch is the additional campaign-management purpose, not evidence of credential exfiltration or direct on-chain fund transfers.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

Campaign lifecycle management is not identified in the declared capabilities and is not shown to support any declared endpoint, payment, agent-registration, or staking workflow. The dashboard credential and Solana wallet are consistent with the stated ecosystem, but that overlap does not establish that campaign management is covered. The supplied chunk shows script invocations only; it does not establish the script's underlying network activity or any fund movement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

Endpoint information retrieval and credentialed API access fit the declared purpose. However, the campaign-management commands introduce a separate owner-scoped capability absent from the description. The supplied chunk does not expose the scripts' internals, so this finding is limited to the explicitly invoked campaign operations; it does not establish fund transfers or credential misuse.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `references/payments-integration.md`, `references/webhooks-verification.md`, `references/agentic-endpoints.md` |