Prevent concurrent login submissions - #5367
Conversation
|
Thanks for this, the reasoning in the code comments made the review easy to follow. A few things I want to call out as genuinely well done, because they're the parts I checked hardest: using Could you address the following before I merge?1. The MFA method buttons are not covered by the freeze. 2. A hung 3. Please drop the issue reference from 4. The test harness anchors on comment text. 5. Please state the scope explicitly in the PR body. Two minor points:
On #5365: I agree with your assessment and I appreciate you writing it down rather than claiming the fix. The reported symptom (a correct password rejected on the first two attempts and accepted on the third) is not what duplicate submissions produce on their own, so this should not be merged as closing that issue. It is still worth having: two spurious On my side I verified: the branch merges cleanly into current Thanks again, ping me once the above is in and I'll merge. |
|
Thanks for the detailed review, @nilsteampassnet. The corrections are in aa593d469.
All checks are green for this commit:
Live LDAP/MFA/SSO testing and visual verification of the selectors remain listed as pending in the PR and manual checklist; the local browser tooling was unavailable. No server-side credential-validation change or new library was introduced. |
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.