Repository navigation
serve: keep the access code out of the log, and 0.5.3 - #52
Merged
Merged
Conversation
Off a terminal the startup URL now stops at the `#`. Everything after it is the access code, and a fragment is never sent in an HTTP request -- which is the whole reason the code lives there, and then the listener wrote it into a journal systemd is happy to ship somewhere else. The QR goes with it, which #49 did not ask for and needs saying. It is gated on -noqr alone today, so a headless listener without that flag encoded the same URL, code and all, into eighteen lines of block characters on every reconnect. Dropping only the text would have moved the credential into pixels rather than removed it. A QR is for a camera pointed at a screen, which is the same test the banner already uses. On a terminal nothing changes: the URL stays whole and the QR stays, because that is where it is read in order to be used. The code is 8 bytes and lives in the identity, so it survives restarts. A log line leaked it for the life of that identity, not of that process. Reported by @lars18th, who found it in an OpenWRT journal.
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.
Two commits: the #49 fix, and the version bump for 0.5.3.
Fixes #49.
Off a terminal the startup URL now stops at the
#, and the QR goes withit. Everything after the
#is the access code, and a fragment is neversent in an HTTP request -- which is the point of putting it there, and then
the listener wrote it into a journal on every reconnect.
The QR half is not what #49 asked for and is the part worth a second look.
It is gated on
-noqralone, so a headless listener without that flagencoded the same URL, code and all, as eighteen lines of block characters.
Fixing only the text would have moved the credential into pixels.
On a terminal nothing changes -- the URL stays whole and the QR stays.
Left alone deliberately:
connect_pair.goafter pairing, and the shareControl/View URLs. Both are one-shot output where handing you the credential
is the entire point, rather than a block reprinted on every reconnect.
Test
TestReadyBlockKeepsTheCodeOffNonTerminalscovers piped and daemon, andasserts a terminal still gets both. It fails without the fix. The existing
piped and daemon assertions changed, since they asserted the full URL
reaches a non-terminal, which is the behavior being fixed.
TestReadyBlockNoQRnow builds a TTY display explicitly: undergo teststdout is not a terminal, so
newDisplaywould produce no QR either way andthe test would have proved nothing.