T09 · Insecure Skill Coding Practices
- Location
SKILL.md:25- Finding
Private Nostr Keys Exposed Through Command-Line Arguments
- Content
View full analysis
wss://relay.damus.io # SKILL.md:29 nak event -c "I agree!" -e --sec wss://relay.damus.io # SKILL.md:33 echo '{"name":"bob","about":"builder"}' | nak event -k 0 --sec wss://relay.damus.io # SKILL.md:83 nak encrypt --sec --target "Secret message" # SKILL.md:87 nak decrypt --sec --source # SKILL.md:94 nak wallet --sec # SKILL.md:98 nak wallet pay --sec lnbc1... # SKILL.md:106 nak blossom upload --server https://cdn.example.com --sec ./image.png ``` ### Technical Analysis The Skill repeatedly recommends passing a Nostr private key through the `--sec` command-line argument. When an agent or user replaces the placeholders with a real `nsec` or hexadecimal private key, that secret becomes part of the process invocation. Depending on the operating environment, command-line arguments may be exposed through: - Shell history and command auditing. - Process inspection utilities and process metadata. - Terminal capture, debugging, telemetry, or session recording. - Agent execution transcripts and tool-call logs. - Monitoring systems that record complete process invocations. - Error reports that reproduce the original command. This behavior is not required for the Skill's declared network functionality if `nak` supports a safer secret-input mechanism. It therefore exceeds minimum safe exposure even though possession of a private key is legitimately required for signing, decryption, wallet operations, and authenticated uploads. The documented network operations themselves—relay publication and queries, wallet co ...[truncated 2051 chars]- Remediation
View remediation
