Skip to content

fix(login): drop the session when the directory fails during a login - #4032

Merged
marevol merged 1 commit into
mainfrom
fix/login-form-directory-failure
Dec 4, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/login-form-directory-failure

Conversation

@marevol

@marevol marevol commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

With LDAP, a directory can accept the password and then fail a search made for the same login, for example when the result is cut off by a size limit (reported as a failure since #4022) or the connection is lost.

/api/v2/auth/login handles this: it answers 503 and drops the session. The form login (POST /login/login) did not: it answered HTTP 500, and the session stayed bound to the user. Once the directory recovered, the same cookie was authenticated although no LOGIN record had been written to the audit log.

Change

  • LoginAction: on LdapOperationException, log a warning, log the user out and show the login form with "Login failed." (the password was not refused, so no failure is recorded against the user).
  • SsoAction: the same handling on the SSO login, which has the same shape.

Tests

  • New tests in LoginActionTest and SsoActionTest; both fail without the change.
  • The form login handling was also checked against a running Fess with OpenLDAP (size limit, time limit and dropped connection after the bind), before the message was changed to "Login failed."; the message itself is covered by the unit test. The SSO path is covered by the unit test only.

@marevol marevol added this to the 15.10.0 milestone Dec 4, 2026
@marevol marevol added the bug label Dec 4, 2026
When the directory accepted the password and the following search failed
(a result cut off by a size limit, a lost connection), the form login
answered HTTP 500 and left the session bound to the user, without a LOGIN
record. The form login and the SSO login now log the user out and go back
to the login page with an error.
@marevol
marevol force-pushed the fix/login-form-directory-failure branch from d031a13 to 64a363e Compare December 4, 2026 05:57
@marevol marevol self-assigned this Dec 4, 2026
@marevol
marevol merged commit 81a6baa into main Dec 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant