Repository navigation
Auth: 1/2/4 s after failed logins, AuthMinLength 10, no decoy hashing - #370
Merged
Merged
Conversation
Failed logins now wait per session only: the first failed AUTHINFO PASS gets its 481 after 1 s, the second after 2 s, the third after 4 s, and the session is closed after the third failure, as before. A successful login answers at once. AuthFailureDelay keeps its name so that 1.3.22 configurations still parse: 0 turns the wait off, any other value (1 to 3600) turns it on; the default is 1. The new option AuthMinLength (default 10, 0 to 255, 0 = off) refuses a user name or password shorter than that many bytes when AUTHINFO PASS arrives, after the failure wait and without a lookup, password check or PAM call. It counts as a failed login. AUTHINFO USER still answers 381, so it reveals nothing. The log line gives the reason without the password. newscache -p prints the option. dummy_password_check() and auth_file_sample_hash() are gone. They hashed the client's password for an unknown user, a locked or empty field and a plain-text field (--enable-plainpass), so that those answered as slowly as a wrong password. We don't want CPU time spent on bots guessing accounts. The real checks (auto_cryptcheck, the constant-time hashes_differ, the plain-text comparison) are unchanged. Tests: TestAuthUnknownUserTiming is removed; TestAuthFailureBackoff, TestAuthSuccessNoDelay, TestAuthFailureNoDelayOff, TestAuthMinLength and TestAuthMinLengthConfig are added in place of the 1-second tests. The e2e harness writes "AuthMinLength 0" unless a test sets it, because the existing tests log in as tester/secret and the system's test users. The sample auth file and the documentation examples use names and passwords of at least 10 characters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AuthMinLength counts bytes, and a 9-character name of multibyte characters can be 10 bytes long, so the docs said something else than the check does. They now say bytes too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
go-while
added a commit
that referenced
this pull request
Nov 12, 2026
Found by nc-oc-gpt61t: the bullet said the log names the user only after a password check, but #370's AuthMinLength refusals name it too (with the reason), as the New options entry says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Login handling as go-while decided (#366 was closed as declined: "We are not a banking system and we don't want CPU cycles wasted on bots bruteforcing accounts. No fake password hashing to prevent timing attacks.").
Changes
dummy_password_checkandauth_file_sample_hashare gone. An unknown user, a locked or empty password field, or a plain-text field no longer costs acrypt(). The real checks (auto_cryptcheck, constant-timehashes_differ, plain-text handling) are unchanged.AuthFailureDelaykeeps its name, since 1.3.22 configs set it. 0 turns the waiting off; any other value (0–3600 still parse) turns the 1/2/4 s rule on. The default is on.AuthMinLength(default 10, 0 = off, range 0–255), one value for the user name and the password. A shorter name or password gets 481 after the failure wait, without a lookup, password check or PAM call, and counts as a failure. It is checked at PASS, so USER reveals nothing. The log line names the reason, never the password.alice-reader,reader-one/password-one).Tests
TestAuthUnknownUserTiming,TestAuthFailureDelayandTestAuthFailureDelayFixed.AuthMinLength 0, so the existing tests keep their short test users.TestAuthFailureBackoff: 1/2/4 s, then close. Also withAuthFailureDelay 15.TestAuthMinLength: 9 bytes refused even with the right password and counted as a failure; 0 turns the check off; a 10-byte, 9-character name logs in.TestAuthMinLengthConfig:-pprints both options; out-of-range values are errors.TestAuthSuccessNoDelayandTestAuthFailureNoDelayOff.Tested (by the implementing agent)
--with-pam --enable-plainpassbuilds cleanly.For the release branch
The 1.3.23 NEWS entries about the flat 1 s AuthFailureDelay and the dummy hash check become wrong.
changes/fix-auth-failure-backoff.mdreplaces them when the release PR moves it in. REVIEW.md rows #283, #292 and #378 need an update in the next docs batch.NEWS:
changes/fix-auth-failure-backoff.md.🤖 Generated with Claude Code