T09 · Insecure Skill Coding Practices
- Location
SKILL.md:59- Finding
Private Key Exposure Through Process Arguments
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 59-65; the unsafe signing pattern is repeated at lines 151, 189, 205, 218, 245, 279, 314, 325, 336, and 424.
Vulnerability Type: Private key disclosure through shell argument expansion
Risk Level: HighVulnerable Code
bash # Export in your shell session (not in a file that gets committed) export ETH_PRIVATE_KEY=0x... # Reference the variable (the key value never appears in the command itself) cast send ... --private-key $ETH_PRIVATE_KEYThe same unsafe alternative is repeatedly recommended in transaction examples:
bash # Or: --ledger | --trezor | --private-key $ETH_PRIVATE_KEYTechnical Analysis
The statement that the private key “never appears in the command itself” is misleading. Although shell history normally records the literal variable reference, the shell expands
$ETH_PRIVATE_KEYbefore invokingcast. The resulting private key is therefore supplied to the child process as a command-line argument.Depending on operating-system configuration, process arguments may be observable through process inspection interfaces, monitoring or endpoint-security software, command wrappers, debugging tools, audit logs, and crash diagnostics. Any process or user with sufficient local visibility during transaction signing could capture the expanded key.
This is particularly severe because the Skill is designed for blockchain transactions involving token approvals and vesting contracts. A private key is a reusable bearer credential rather than a transaction-scoped secret.
Attack Path
- A user follows the Skill instructions and exports a funded wallet key as
ETH_PRIVATE_KEY. - The user executes a documented command containing
--private-key $ETH_PRIVATE_KEY. - The shell expands the variable and launches
castwith the raw private key in its process argument vector. - A malicious or compromised local process, monito ...[truncated 983 chars]
- A user follows the Skill instructions and exports a funded wallet key as
- Remediation
View remediation
Remediation Suggestions
- Remove
--private-key $ETH_PRIVATE_KEYfrom all command examples and do not describe environment-variable expansion as preventing argument exposure. - Require hardware-wallet signing through
--ledgeror--trezorfor production and mainnet transactions. - Recommend an encrypted Foundry keystore with
--account <name>as the default software-based signing method. - If environment-based signing must remain available, clearly warn that passing the variable to a command-line option exposes its expanded value through the process argument vector.
- Use a signer integration that reads credentials through a protected keystore, hardware device, operating-system credential facility, or another channel that does not place secrets in command-line arguments.
- Advise users who have already followed these instructions to assess local telemetry exposure and rotate potentially compromised production keys.
- Remove
