ethereum-wallet-toolkit
nirholas/ethereum-wallet-toolkit
- Type
- MCP server
- Scanned
- Nov 17, 2026
- Version
- c8ead96f24c5
- Files read
- 265
This project provides five local MCP servers, a Claude plugin, CLI utilities, and offline HTML pages for generating Ethereum wallets, managing keystores, and signing messages or transactions, alongside an optional x402 HTTP payment facilitator. The biggest risk to someone who installs the MCP servers is that keystore-mcp-server has no path restrictions on its file tools, allowing a prompt-injected agent to read any JSON file on the machine or overwrite arbitrary user files with raw 32-byte payloads.
What it can reach
- Secrets
- Generates, decrypts, and signs data with Ethereum private keys, BIP39 seed phrases, and keystore passwords passed to its tools, and uses FACILITATOR_PRIVATE_KEY in the optional x402-facilitator service.
- Files
- Reads and writes keystore JSON files and exported private key files at caller-supplied paths in keystore-mcp-server and the Python CLI scripts.
- Network
- The five MCP servers make no network calls during operation, but the Claude plugin downloads ethereum-wallet-mcp from PyPI via uvx, and the optional x402-facilitator listens on HTTP port 3402 and connects to EVM RPC endpoints and optional Redis.
Findings
-
HighArbitrary file overwrite and raw-byte payload write in keystore_to_private_key_file
keystore-mcp-server/src/keystore_mcp/tools/file_ops.py:315
The keystore_to_private_key_file tool (and similarly save_keystore_file via directory and filename) accepts any filepath on the user's filesystem, creates missing parent directories, and atomically overwrites existing files. When output_format is set to raw_bytes, it writes the decrypted 32-byte key directly to disk as raw bytes. Because any 32-byte ASCII string represents a valid secp256k1 private key integer, an attacker who tricks the AI agent via prompt injection can pass a crafted keystore JSON and password to overwrite critical user files or write a 32-byte Python .pth startup hook or shell profile payload to achieve code execution.
Fix: Confine all file writes to a dedicated keystore directory, reject path separators and parent-directory segments in filenames, refuse to overwrite existing files, and remove the raw_bytes output mode.
-
HighArbitrary JSON file disclosure in load_keystore_file with stubbed path traversal check
keystore-mcp-server/src/keystore_mcp/tools/file_ops.py:170
The load_keystore_file tool accepts any file path on disk because validate_filepath in utils/file_utils.py contains a no-op pass statement where path traversal should be checked. Furthermore, even when validate is True by default and validate_keystore_structure determines that the target file is not an Ethereum keystore, load_keystore_file still returns the entire parsed JSON object in the keystore field. If the AI agent is prompt-injected, an attacker can read any JSON object file on the user's computer, including Docker auth configs, cloud service-account keys, or MCP client configuration files.
Fix: Restrict load_keystore_file to a configured keystore directory, enforce real path-containment checks in validate_filepath, and return an error without including the parsed JSON contents when keystore structure validation fails.
-
MediumUnauthenticated x402-facilitator settlement endpoint bound to 0.0.0.0 with wildcard CORS
x402-facilitator/src/index.ts:32
When the optional x402-facilitator server is run, it binds to 0.0.0.0:3402 with CORS_ORIGINS set to * by default and places no authentication or recipient (payTo) allowlist on POST /settle. Anyone on the network, or any website the user visits in a browser, can send valid self-signed USDC transfer authorizations for arbitrary recipients and force the facilitator's funded private key to pay on-chain gas to settle them.
Fix: Bind to 127.0.0.1 by default, require authentication (such as an API key) from trusted resource servers on /verify and /settle, restrict CORS origins, and allowlist permitted payTo recipient addresses.
-
LowMissing on-chain nonce check and spoofable rate limit enable gas-draining replays in x402-facilitator
x402-facilitator/src/core/facilitator.ts:148
Contrary to the x402-facilitator README, Facilitator.settle never calls authorizationState on-chain or uses nonce-store.ts before calling writeContract; it only calls verifyPayment, which checks signature validity and token balance. In addition, rateLimitMiddleware keys rate limits on the client-controlled X-Forwarded-For header. If x402-facilitator is running, an attacker can repeatedly replay an already-used authorization while rotating X-Forwarded-For headers, causing the facilitator wallet to submit reverting on-chain transactions and burn its ETH gas balance.
Fix: Check authorizationState on-chain and record nonces in NonceStore before calling writeContract (or simulate the contract call first), and use the socket peer address rather than untrusted X-Forwarded-For headers for rate limiting.
-
LowBoolean environment coercion keeps Base mainnet enabled when set to false in x402-facilitator
x402-facilitator/src/config/env.ts:24
The environment schema parses ENABLE_BASE and other chain flags using z.coerce.boolean(), which calls Boolean() on the raw environment variable string. Because Boolean('false') evaluates to true in JavaScript, setting ENABLE_BASE=false in .env fails to disable Base mainnet and still loads the facilitator's private key onto mainnet using the default public Base RPC URL.
Fix: Replace z.coerce.boolean() with an explicit string check such as z.enum(['true', 'false']).transform((v) => v === 'true') so 'false' and '0' disable the chain as expected.
-
LowUnpinned PyPI package execution in Claude plugin MCP configuration
plugins/ethereum-wallet-toolkit/.mcp.json:5
The plugin configuration launches ethereum-wallet-mcp via uvx without pinning a version or hash, fetching and executing whatever version is latest on PyPI rather than running the local repository code or a fixed release. For a tool that generates and signs with raw cryptocurrency private keys and seed phrases, an upstream PyPI compromise would automatically run untrusted code with access to wallet secrets.
Fix: Pin an exact version (for example, ethereum-wallet-mcp==1.0.0) or run the server from the local repository package.
-
LowSensitive files created with default umask before chmod is applied
keystore-mcp-server/src/keystore_mcp/utils/file_utils.py:84
In secure_write_file, the temporary file is created with open(temp_path, 'wb') using the process's default umask (typically 0644, readable by other local users) and populated with data—including plaintext private keys in keystore_to_private_key_file—before os.chmod sets permissions to 0600. Likewise, the standalone CLI scripts eth_toolkit.py and wallet.py write plaintext private keys and mnemonics with open(..., 'w') without restricting permissions.
Fix: Create the file descriptor using os.open(temp_path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, permissions) so 0600 permissions apply before any secret bytes are written, and apply the same pattern in eth_toolkit.py and wallet.py.
