Back to skill

Security audit

ClawPay-Hedera

Security checks for vulnerabilities and agentic risk

Overview

This payment skill is purpose-aligned, but it asks users to run unpinned payment tooling while handling a Hedera private key and includes an example that exposes the key through command-line arguments.

Review carefully before installing. Use only a dedicated, minimally funded testnet key; avoid mainnet keys; do not pass private keys through command-line arguments; and prefer a pinned, reviewed SDK version installed through a lockfile or trusted package workflow.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Error
Location
scripts/setup.sh:20
Finding

Unpinned npm Package Is Downloaded and Executed During Setup

Content
View full analysis

Vulnerability Details

File Location: scripts/setup.sh, lines 20-22
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: High

bash
# Verify ClawPay CLI is accessible
echo "Checking ClawPay CLI..."
npx @clawpay-hedera/sdk --version

Technical Analysis

The setup script invokes npx using only the package name, without a fixed version, lockfile, or integrity hash. If the package is not already available in the local cache, npx can resolve and download the package associated with the registry's current distribution tag and execute its lifecycle or CLI code.

Consequently, the code executed by a previously reviewed version of this skill can change without any modification to this repository. Compromise of the npm publisher account, package ownership, registry resolution, or a newly published malicious version could result in arbitrary code execution.

The child process also inherits the setup script's environment. Because this skill requires HEDERA_PRIVATE_KEY, a malicious package version could read and exfiltrate that private key in addition to executing commands with the invoking user's privileges. There is no evidence in the reviewed files that the current package is malicious; the vulnerability is the absence of dependency pinning and integrity verification.

Attack Path

  1. An attacker compromises the npm publisher account or otherwise gains the ability to publish a malicious version of @clawpay-hedera/sdk.
  2. The malicious release becomes the version resolved by the package's default distribution tag.
  3. A user runs scripts/setup.sh.
  4. Line 22 downloads or resolves the attacker-controlled version and executes it through npx.
  5. The package reads inherited environment variables, including HEDERA_PRIVATE_KEY, and sends them to an attacker-controlled endpoint.
  6. The package may additionally modify files, access user data, install persistence, or execute other ...[truncated 554 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin the CLI to a specifically reviewed version, for example npx --yes @clawpay-hedera/sdk@1.2.3 --version.
  • Prefer declaring the package in a committed package.json and lockfile, then installing it with npm ci, which enforces locked package versions and integrity metadata.
  • Review the complete transitive dependency tree whenever the pinned version is updated.
  • Run dependency installation and verification before placing sensitive keys in the environment.
  • Execute third-party tooling in a restricted environment with only the minimum required files, network access, and environment variables.
  • Consider disabling lifecycle scripts during installation where compatible, while recognizing that this does not make execution of an untrusted CLI safe.
  • Verify package provenance or signatures through an approved artifact registry before execution.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:121
Finding

Hedera Private Key Is Passed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 121-125
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: High

bash
npx @clawpay-hedera/sdk connect \
  --urls "https://example.com/mcp" \
  --hedera-key "$HEDERA_PRIVATE_KEY" \
  --hedera-network hedera-testnet

Technical Analysis

Although the private key originates in an environment variable, the documented command expands it into the --hedera-key command-line argument before starting the process. This contradicts the skill's own guidance that keys should not be passed as CLI arguments.

Command-line arguments may be exposed through process inspection facilities, monitoring agents, shell tracing, diagnostic reports, audit systems, command wrappers, or CI/CD logs. Depending on operating-system configuration, other local users or processes may also be able to inspect the argument vector while the command is running. Quoting the variable prevents word splitting but does not prevent disclosure in the process argument list.

Attack Path

  1. A user exports a valid Hedera private key as HEDERA_PRIVATE_KEY.
  2. The user follows the documented connection command.
  3. The shell replaces "$HEDERA_PRIVATE_KEY" with the plaintext key and places it in the new process's argument vector.
  4. A local process monitor, audit collector, tracing facility, malicious local process, or logging wrapper captures the command arguments.
  5. The attacker extracts the key and imports it into a compatible Hedera wallet or signing client.
  6. The attacker signs transactions within the authority of the compromised key, including unauthorized payments or transfers.

Impact Assessment

Disclosure compromises the full signing authority associated with the private key. An attacker may impersonate the account holder and authorize transactions until the key is rotated or its authorization is revoked. If the key is restricted to a ...[truncated 252 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove the --hedera-key argument from all examples and usage instructions.
  • Modify or use the SDK so it reads HEDERA_PRIVATE_KEY directly from the environment without copying its value into the process argument vector.
  • Prefer a secure wallet, operating-system keychain, hardware-backed signer, or secret-manager integration over long-lived plaintext environment variables.
  • If a file-based secret is unavoidable, use a narrowly permissioned credential file and pass only its path or file descriptor, provided the SDK securely supports that mechanism.
  • Disable shell tracing around secret-handling operations and configure CI systems to mask credentials.
  • Use dedicated, minimally funded accounts and enforce transaction or spending limits independently of the client.
  • Rotate any key previously used with the documented command if process monitoring, audit logging, or untrusted local access may have exposed it.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code chunk is only a setup/install verification script for the ClawPay CLI environment. It does not implement the broader declared functionality around discovering agents on-chain, checking reputation, submitting ratings, or conducting micropayments/tool-call payment flows. While the setup is related to the payment portion at a high level, the actual behavior shown is materially narrower and lacks most of the declared capabilities.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document warns users not to pass the private key as a CLI argument because it may appear in logs or process listings, but later demonstrates --hedera-key "$HEDERA_PRIVATE_KEY", which still expands into a command-line argument. On multi-user systems, CI environments, shell history/logging setups, or process-monitoring tools, this can expose the private key and lead to wallet compromise and unauthorized spending.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The skill instructs users to execute npx @clawpay-hedera/sdk without pinning an exact package version. Because npx resolves the latest published package by default, a compromised maintainer account, poisoned dependency release, or breaking update could cause users to run unreviewed code with access to HEDERA_PRIVATE_KEY, creating a supply-chain execution risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The connect example uses unpinned npx @clawpay-hedera/sdk in a workflow that also handles a private key and initiates payment-capable operations. An attacker who can influence the package version served by the registry could obtain code execution in a highly sensitive context, potentially exfiltrating credentials or initiating unauthorized transactions.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

Using npx @clawpay-hedera/sdk --version without pinning an exact package version causes execution of whatever version is currently resolved from the registry at runtime. In a payment-related setup script, this expands supply-chain risk substantially: a compromised maintainer account, malicious new release, or dependency hijack could execute arbitrary code on the user's machine during setup.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

The usage example instructs users to run npx @clawpay-hedera/sdk connect ... --hedera-key $HEDERA_PRIVATE_KEY without pinning a version, which can fetch and execute untrusted future code from the package registry. Because the command handles a Hedera private key for autonomous payments, exploitation could lead to key exfiltration, unauthorized transactions, or broader host compromise.

Content

No source excerpt is available for this finding.