From a311e81a12a845255163e5164c3a9b675057d477 Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Tue, 2 Dec 2025 21:08:56 +0200 Subject: [PATCH] Phase 2: Add CSRF token protection to all forms and processors - Created CsrfMiddleware class with 8 helper methods - Added CSRF tokens to 9 POST forms across trip/course/camping/membership - Added CSRF validation to all 10 POST processors - CsrfMiddleware.requireToken() validates and dies on invalid tokens - 100% POST endpoint coverage with CSRF protection --- add_campsite.php | 7 ++ bush_mechanics.php | 1 + campsite_booking.php | 1 + campsites.php | 1 + driver_training.php | 1 + login.php | 1 + membership_application.php | 1 + process_application.php | 4 + process_booking.php | 5 ++ process_camp_booking.php | 4 + process_course_booking.php | 5 ++ process_eft.php | 9 +++ process_membership_payment.php | 7 ++ process_signature.php | 4 + process_trip_booking.php | 8 ++ rescue_recovery.php | 1 + src/Middleware/CsrfMiddleware.php | 122 ++++++++++++++++++++++++++++++ trip-details.php | 1 + validate_login.php | 7 ++ 19 files changed, 190 insertions(+) create mode 100644 src/Middleware/CsrfMiddleware.php diff --git a/add_campsite.php b/add_campsite.php index 73608405..77eafc44 100644 --- a/add_campsite.php +++ b/add_campsite.php @@ -1,7 +1,14 @@