Bug 29924: Avoid leaking information on wrong credentials
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 26 Apr 2022 18:03:05 +0000 (15:03 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 6 May 2022 20:33:09 +0000 (10:33 -1000)
commit6fba85d23bf419516111ff959bb5ab7c67ee6414
treeca8cd68535b1c99ae7be4e2d015bf0740f828d39
parent4e2cfbe75ec350e1985c0af51a40bf152a69e44e
Bug 29924: Avoid leaking information on wrong credentials

If the passed credentials are wrong, we shouldn't expose things like the
password is expired.

This patch takes care of that.

To test:
1. Have a known patron with password_expiration_date set so its
   password is expired. Can be done like:
   $ koha-mysql kohadev
   > UPDATE borrowers \
     SET password_expiration_date='2022-04-25' \
     WHERE borrowernumber=132;
   Note: change the borrowernumber
2. Attempt to login to the OPAC with wrong credentials
=> SUCCESS: You are rejected, with a message telling credentials are
            wrong
=> FAIL: You are told the password is expired.
3. Apply this patch and restart Plack
4. Repeat 2
=> SUCCESS: You are rejected, credentials are wrong and no mention to
            password being expired.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Auth.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt