Prevent concurrent login submissions - #5367
Open
guerricv wants to merge 2 commits into
Open
Conversation
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.
Description
Repeated Enter presses, clicks or YubiKey events can start overlapping login requests while an earlier attempt is still pending. This change allows one submission at a time and gives the form a consistent busy state.
Server-side credential validation and brute-force controls are unchanged. Completed attempts can be retried immediately; no artificial delay is introduced.
Related issue
None. General login-form hardening.
Type of change
How has this been tested?
All CI checks passed for commit
54b81982b2f7b482681da191863594fd7248751a.Local checks also passed: 40 JavaScript tests, 94 targeted PHP 8.2 authentication tests (245 assertions), PHPStan level 4, PHP syntax validation on 8.2/8.3, and
git diff --check.The JavaScript suite executes the shipped login code with simulated controls, HTTP responses, navigation and timers. It covers duplicate events, failures, MFA, redirects and session renewal.
Live browser/provider validation remains to be completed: local/LDAP login, Google/YubiKey MFA, Duo/OAuth2 redirects and callbacks, browser Back navigation and expired sessions. Administrator/non-administrator redirects are simulated; live manager/standard/read-only roles, personal folders on/off and audit-log creation have not been exercised. See
tests/JavaScript/README.mdfor the manual checklist.Checklist
php app/vendor/bin/phpstan analyse --memory-limit=2G)php _tools/phpunit.phar— see CONTRIBUTING.md for the one-time setup)var_dump()orconsole.log()left in the code — no new debugging statements; existing guarded logging is unchanged.app/sources/*.queries.phpfiles have a matchingpublic/sources/proxy shim — not applicable, no new handlers.teampassclasseswere applied to both copies (app/includes/libraries/andapp/vendor/) — not applicable, no class changes.app/vendor/composer/is in its production form (git checkout -- app/vendor/composer/)Impact on install / upgrade
install/upgrade_run_X.X.X.phpscript is included and the fresh install path was testedNo installer or upgrade migration is needed.
Screenshots
Not captured locally. The change concerns the form's busy state and submission lifecycle; browser validation is listed above.