T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:61- Finding
Overly Broad Discovery and Selection of Local Wallet Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 61-79
Vulnerability Type:T05: Unauthorized Access and Privilege Escalation
Risk Level: HighVulnerable Code Snippet
markdown ## Step 2 - Discover a wallet on disk When execution is requested, look for an existing usable wallet locally before asking the user for anything else. Preferred wallet sources: 1. A project or workspace `.env` with a private key or mnemonic 2. A local JSON keystore plus an available password source on disk 3. Existing wallet config files in the workspace or common agent-accessible directories Wallet handling rules: - Use the first valid wallet that matches the requested network and has enough funds - Never print the secret, keystore JSON, mnemonic, or full env file content - If multiple wallets are found, summarize them by public address only and choose the best-funded viable one unless the user specified a different address - If no wallet is found, say that clearly and stop rather than fabricating one - If a wallet is found but lacks gas or assets, report that and do not attempt executionTechnical Analysis
The Skill instructs the agent to search for highly sensitive wallet credentials, including private keys, mnemonic phrases, keystores, and corresponding password sources. The search scope includes vaguely defined “common agent-accessible directories,” rather than being confined to a credential path explicitly authorized by the user.
This violates least-privilege principles in two ways:
- It permits access to credentials beyond the minimum scope necessary for the requested bridge transaction.
- It authorizes automatic wallet selection based on discovery order or available funds rather than explicit ownership and wallet authorization.
The instruction not to print secrets only limits direct disclosure in chat. It does not prevent the agent from reading an unrelated credential, retainin ...[truncated 1996 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove automatic searches for private keys, mnemonic phrases, keystores, and password sources.
- Require the user to specify the exact public wallet address intended for the operation.
- Require an explicit, user-approved credential path or an established wallet-provider integration; do not infer authorization from filesystem accessibility.
- Restrict credential access to a narrowly allowlisted directory and canonicalized file path within the task workspace.
- Reject paths that escape the approved directory through absolute paths, symbolic links, traversal sequences, or mount points.
- Never select a wallet based on discovery order, token balance, or gas balance. If several authorized wallets exist, require the user to select one by public address.
- Separate consent into distinct stages: permission to access the named credential, approval of the exact source and destination chains, and final confirmation of the asset, amount, address, fees, and transaction calldata before signing.
- Prefer hardware wallets or wallet-provider APIs that keep private key material outside the agent's context.
- Ensure logs, error messages, tool outputs, and model responses redact private keys, mnemonics, keystore contents, passwords, RPC credentials, and complete environment files.
- Clear sensitive execution context after use and avoid persisting wallet material in memory, caches, temporary files, or telemetry.
- Record an auditable authorization event containing only non-secret details, such as the selected public address and approved transaction parameters.
