Back to skill

Security audit

Hypha Payment

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for Hypha payments, but it handles wallet seed material unsafely and gives real-payment examples without adequate safeguards.

Review carefully before installing. Do not use a real funded wallet seed with the setup script, avoid placing seeds on the command line or in logs, test only on Base Sepolia, pin and review hypha-sdk before use, and require explicit human approval for any USDT payment, escrow creation, or mainnet transaction.

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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup_agent.py:17
Finding
Wallet Seed Exposed Through Process Arguments and Plaintext Output## Vulnerability Details **File Location**: `scripts/setup_agent.py:17-37` **Vulnerability Type**: Plaintext exposure of wallet seed material **Risk Level**: High ### Vulnerable Code ```python if len(sys.argv) < 2: print("Usage: python3 setup_agent.py <agent-seed-phrase>") print("Example: python3 setup_agent.py 'my-cool-agent-v1'") sys.exit(1) seed_phrase = sys.argv[1] try: from hypha_sdk import SeedManager except ImportError: print("hypha-sdk not installed. Run: pip install hypha-sdk") sys.exit(1) sm = SeedManager.from_string(seed_phrase) print("=" * 50) print(" HYPHA Agent Identity") print("=" * 50) print(f" Seed Phrase: {seed_phrase}") print(f" Node ID: {sm.node_id_hex}") print(f" Wallet: {sm.wallet_address}") print(f" Full Node ID: {sm.node_id.hex()}") print("=" * 50) print() print("Add to your agent config:") print(f' agent = Agent(seed="{seed_phrase}")') ``` ### Technical Analysis The script accepts the agent seed as a command-line argument and subsequently prints it twice in plaintext. Command-line secrets can be exposed through shell history, process inspection facilities, terminal recording, CI job metadata, debugging systems, and command auditing. Printing the seed additionally exposes it to terminal scrollback and collected stdout logs. According to `references/network.md:39-44`, the same seed is used to derive the P2P node identity and the EVM wallet private key: ```text A single 32-byte seed derives: 1. P2P Node ID 2. DHT Location 3. EVM Wallet — secp256k1 private key ``` Consequently, this value is not merely an agent name or configuration identifier. It is wallet key material whose disclosure permits deterministic reconstruction of the wallet private key. The usage example also encourages a human-readable value such as `my-cool-agent-v1`. This may have insufficient entropy and could be vulnerable to offline d ...[truncated 1651 chars]
Remediation
## Remediation Suggestions 1. Do not accept wallet seeds through command-line arguments. Read an existing secret using `getpass.getpass()` or retrieve it from a protected operating-system keystore. 2. Never print the seed, private key, or configuration statements containing the seed. 3. Generate seeds with a cryptographically secure random number generator rather than encouraging human-readable phrases. 4. Store wallet material in an encrypted keystore with restrictive file permissions and explicit access controls. 5. Print only non-sensitive public identifiers, such as the wallet address and public node ID. 6. Add warnings preventing users from placing seeds in shell history, environment diagnostics, source files, or logs. 7. Redact secrets from exception messages and operational telemetry. 8. Treat any seed previously processed by the current script as potentially exposed. Migrate funds to a newly generated wallet and replace the associated P2P identity. 9. Correct the script documentation so it accurately states whether a seed is generated or imported. A safer interactive pattern would be: ```python from getpass import getpass seed_phrase = getpass("Enter agent seed: ") sm = SeedManager.from_string(seed_phrase) print(f"Node ID: {sm.node_id_hex}") print(f"Wallet: {sm.wallet_address}") ``` For new identities, secure random generation and encrypted storage should be preferred over manually entered phrases.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:12
Finding
Unpinned Third-Party Package Used for Wallet and Payment Operations## Vulnerability Details **File Location**: `SKILL.md:12-14` **Related Locations**: `SKILL.md:126-127`, `references/network.md:47-53`, `scripts/setup_agent.py:21-26` **Vulnerability Type**: Unpinned security-sensitive dependency **Risk Level**: Medium ### Vulnerable Code ```bash pip install hypha-sdk ``` The package is subsequently trusted with wallet seed material: ```python try: from hypha_sdk import SeedManager except ImportError: print("hypha-sdk not installed. Run: pip install hypha-sdk") sys.exit(1) sm = SeedManager.from_string(seed_phrase) ``` Although `references/network.md` identifies a current version, the installation command does not constrain installation to that version: ```markdown ## SDK Install ```bash pip install hypha-sdk ``` Current version: **0.2.0** ``` ### Technical Analysis The documented installation command resolves the latest package version available from the configured Python package index at installation time. No exact version constraint, package hash, lockfile, or reproducible dependency manifest is supplied. This dependency is security-sensitive because the documented workflows give it access to wallet seeds, derived private keys, network communication, payment recipients, transaction values, and protocol-fee handling. Installation and runtime code execute with the privileges of the user running the Skill. Identifying version `0.2.0` in prose does not ensure that this version is installed. Even explicitly pinning a version without verifying its artifact hash would still leave ambiguity if an index or artifact were compromised. No evidence in the audited project proves that the referenced package is currently malicious. The vulnerability is the unsafe and mutable supply-chain trust model used for software that handles financial credentials and transactions. ### Attack Path 1. A user follows the documented prerequisite and runs: ```bas ...[truncated 1479 chars]
Remediation
## Remediation Suggestions 1. Pin the SDK to a specifically reviewed release, for example: ```bash python -m pip install "hypha-sdk==0.2.0" ``` 2. Record cryptographic hashes for approved distribution artifacts and install with `--require-hashes`. 3. Supply a committed lockfile or hashed requirements file covering the complete transitive dependency graph. 4. Verify that the package index publisher, source repository, release tag, and built artifact correspond to the reviewed implementation. 5. Review the dependency's seed derivation, private-key handling, RPC communication, recipient validation, fee calculation, and transaction-signing paths before permitting real-fund use. 6. Perform installation in an isolated virtual environment under a non-privileged account. Do not install wallet-related dependencies with administrator or root privileges. 7. Use an organization-controlled package mirror containing only reviewed artifacts where practical. 8. Add automated dependency vulnerability, provenance, and hash verification to CI. 9. Test payment behavior on Base Sepolia before enabling mainnet transactions. 10. Ensure upgrades are explicit security-reviewed changes rather than automatically resolving the latest published package. A hashed requirements file should follow this general form: ```text hypha-sdk==0.2.0 \ --hash=sha256:<verified-distribution-hash> ``` The hash must be obtained from and compared against a trusted, independently verified release artifact.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared description promises broad operational Hypha network and USDT settlement functionality. However, this code only performs identity/wallet derivation and displays configuration information from a provided seed phrase. Although that setup is related to Hypha and wallet usage, it is only a preparatory utility and does not implement the main capabilities claimed in the description. The docstring mentions announcing on the mesh, but no such behavior exists in the actual code chunk. Therefore the description materially overstates what this code actually does.

Missing User Warnings

High
Confidence
99% confidence
Finding
The script prints the seed phrase directly to stdout, which can expose the secret through terminal history, shell logging, CI logs, screen recording, shared consoles, or process capture. In this skill context, the seed deterministically controls both agent identity and wallet access, so disclosure can enable identity takeover and theft of funds.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The documentation includes concrete examples for sending USDT and creating escrow arrangements on a real network, but it does not prominently warn that these actions may transfer real funds, incur fees, and be irreversible. In an agent-skill context, this increases the risk of accidental financial loss if an integrator or autonomous agent follows the examples without explicit confirmation gates or testnet-only defaults.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The script generates and displays derived identity and wallet credentials without warning users that the values are sensitive or linkable to a payment-enabled agent. While the wallet address may be public, the combined display of node identifiers and operational setup details increases the chance of accidental disclosure, profiling, or mishandling in logs and screenshots, especially in a P2P payment skill.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
The docstring says the script generates a seed, derives identity and wallet, and announces on the mesh. In the actual implementation, the script only loads a seed phrase, derives identifiers via SeedManager, and prints them; there is no network join or mesh announcement logic.

Static analysis

No suspicious patterns detected.