Add siteSignMessage so proving xite ownership never exposes the key - #435
Merged
Conversation
Answering an ownership challenge previously meant passing the xite's private key as a command argument, which puts it in shell history and makes it visible to any local process through ps. siteSignMessage signs an arbitrary message with the bound xite's own key instead. The CLI resolves the key in the order that keeps it out of reach: a running node signs with the key it already holds, then this data dir's stored key, and only if neither has it does the command ask, on stdin with terminal echo off. The key is never an argument. The websocket command is admin gated. Signing as the xite is the same authority that signs its content, so an ordinary page must never be able to ask for it.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Adds a way to prove control of a xite's address without the private key ever becoming a command argument.
Why
EpixSites is gaining ownership claims: a xite owner proves they hold the address's key by signing a challenge, and the directory verifies it with
ecdsaVerify. The only way to produce that signature today iswhich writes the key into shell history and exposes it through
psfor as long as the process runs. That is not an acceptable way to ask someone for their key.What this adds
siteSignMessagesigns an arbitrary message with the bound xite's own private key and returns only the signature.CLI:
epix-server siteSignMessage <address> [message]. The key is resolved in the order that keeps it out of reach:The key is never read from an argument in any of those paths, so nothing lands in shell history and nothing shows up in
ps.The websocket command is admin gated. Signing as the xite is the same authority that signs its content, so an ordinary page must never be able to ask for it.
ecdsaSignis unchanged and still signs with the user's auth key, which is a different key and a different trust level.Testing
Against a scratch node:
No stored private key for this xite on this noderather than signing.cargo test -p epix-ui -p epix-serverpasses (353 + 5).