Repository navigation
Refuse a server auth-version-1 answer for an account pinned as v2 (Batch R) - #12
Merged
Merged
Conversation
After a sign-in that sent only the login secret, record the account (SHA-256 of the email) in ~/.shieldfive/auth-pins.json, 0600 in a 0700 dir. A later version-1 answer for it throws LegacyLoginRefusedError before the raw password is posted, unless --allow-legacy-login is passed to sf login, push or sync. Mirrors the mobile and web pins (audit 2026-10-02, Batch R).
Merged
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.
Audit 2026-10-02, Batch R: web and mobile pin "this account is v2"; the CLI obeyed any server
authVersion: 1answer and posted the raw password.Before:
/api/auth/saltanswering version 1 (tampered server, or an account downgraded via a stolen session) madesf login/push/syncsend the raw password.After:
~/.shieldfive/auth-pins.json(SHA-256 of the lower-cased email, file 0600, dir 0700 viaensurePrivateDir, write-then-rename).LegacyLoginRefusedError(code: legacy_login_refused) before anything but the salt lookup is sent.--allow-legacy-loginonsf login,sf push,sf syncoverrides; the pin is kept afterwards.signIn()takes optionalauthPin/allowLegacyLogin; library callers withoutauthPinbehave as before.Tests: new
test/auth.pin.test.mjs(8).npm test: 144/144 pass.Not published; release is the founder's call. CHANGELOG has an Unreleased entry.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.