DIVE-3553: buzz-pair source --nsec - reads the key from stdin, never argv - #5
Merged
Conversation
…argv The verb transfers the CUSTOMER's handset key. cli-v0.1.0's only form is --nsec <bech32>, an argv element that is world-readable in /proc/PID/cmdline for the whole width of a pairing session (up to 120s waiting for the handset). Same rule as _buzz_write_config / _buzz_cli in the CLI repo (DIVE-3509). resolve_payload takes '-' to mean 'first line of stdin'. It is read before any session I/O, which is what keeps the interactive SAS answer working: both reads go through the one buffered io::stdin() handle line-at-a-time, so the y/n answer is simply the next line. The clap doc for --nsec names both '-' and the word stdin, because the 5dive CLI's _buzz_pair_supports_stdin_nsec probes 'source --help' for exactly that and refuses to run against a build that does not say so. Help text and behaviour have to move together, in both directions. scripts/buzz-pair-stdin-nsec.sh grades it: 10 arms, each a measurement rather than an assertion. The key non-vacuity guards are the released cli-v0.1.0 binary failing the help probe, and a positive leak control that passes the key literally and DOES find it in /proc/PID/cmdline -- without that arm, 'no key in argv' proves only that the probe is blind.
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.
DIVE-3553. Written by quinn at
/home/agent-quinn/buzz3553; pushed by ops under thetier-1 delegated-push approval on that row (quinn's seat has no push on
5dive-ai/buzz).Commit is quinn's verbatim —
ce7a878, unamended, so the sha on the row is the sha here.What
buzz-pair source --nsec -reads the key from the first line of stdin instead of argv.cli-v0.1.0's only form is--nsec <bech32>, an argv element that is world-readable in/proc/<pid>/cmdlinefor the whole life of the process — and asourcesession waits up to120s for the handset. The verb transfers the customer's key. Same rule as
_buzz_write_config/_buzz_cliin the CLI repo (DIVE-3509 push-gate finding): the keytravels on stdin, never argv.
How
resolve_payload:Some("-")is replaced byread_line()?before validation. Everythingdownstream is unchanged —
SecretKey::parsestill validates,Zeroizingstill wraps it.source's interactive SASprompt reads stdin too. Both go through the one buffered
io::stdin()handleline-at-a-time, so the SAS
y/nanswer is simply the next line. No buffering or mergingof reads.
--nsecnow names'-'and theword
stdinexplicitly, because the 5dive CLI's_buzz_pair_supports_stdin_nsecprobessource --helpfor exactly that and refuses to run against a build that does not say so(
tests/buzz_pair_unit.shin5dive-ai/5dive, with cli-v0.1.0's verbatim help as itsrefusal control). Help without behaviour breaks the key rule; behaviour without help keeps
the refusal firing.
Caller contract:
{ printf '%s\n' "$nsec"; cat; } | buzz-pair source --nsec - --relay wss://…Grading
scripts/buzz-pair-stdin-nsec.sh— 10 arms, 10/10 green on quinn's seat. The two armsthat make the rest non-vacuous:
cli-v0.1.0binary fails the help probe (refusal control — the probe isnot blind to a build lacking the feature);
/proc/<pid>/cmdline— without it, "no key in argv" would only prove the probe cannot see.Not in this PR
The
cli-v0.1.1cut (workflow_dispatch buzz-cli-release.yml,release_tag=cli-v0.1.1) isthe second half of DIVE-3553 and follows the merge.