Koha-clms/Koha/Middleware
David Cook cd7123734e Bug 37040: Prevent ErrorDocument subrequests from activating CSRF
This change improves the mechanism for preventing the CSRF middleware
being activated by ErrorDocument subrequests.

This change was necessary due to a subtle issue identified by
Bug 37041.

Test plan:
0. Apply the patch
1. Restart Koha
koha-plack --restart kohadev
2. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=9908
3. Log in
4. Note that you get a pretty 403 and not an ugly plain text error
5. Go to http://localhost:8081
6. Fill in the login details, but use the HTML inspector to delete
the csrf_token from the hidden inputs
7. Submit the login
8. Note a pretty 403 page

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c1ac124176)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-06-27 16:14:34 +00:00
..
CSRF.pm Bug 37040: Prevent ErrorDocument subrequests from activating CSRF 2024-06-27 16:14:34 +00:00
RealIP.pm Bug 25950: Remove <client> in X-Forwarded-For from proxy tests 2020-07-20 12:37:29 +02:00
SetEnv.pm Bug 33967: Fix SetEnv middleware to preserve $env integrity 2023-06-09 08:50:12 -03:00
UserEnv.pm Bug 36149: (follow-up) POD and tidy 2024-05-14 15:04:36 -03:00