From 24f3296ec8733e0bf4bd4d7da4ae1056296f9928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drix?= Date: Sat, 31 Oct 2026 08:50:32 +0100 Subject: [PATCH] Jeton CSRF sur tous les formulaires POST du portail (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit csrf_jeton(), csrf_champ() et csrf_verifier() dans inc/auth.php : un jeton par session, comparé par hash_equals, réponse 400 s'il manque ou ne correspond pas. La vérification est appelée en tête de chaque page qui traite un POST — console d'administration (membres, validation, révocation, groupes, services) et pages des membres (profil, mot de passe, inscription, renouvellement d'adhésion) —, et chaque formulaire porte le champ caché. Ajoute aussi e(), l'échappement de sortie à utiliser dans tout nouveau code. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01V2csyno8m71DJFKYM1vgzV --- web/admin/groups.php | 3 +++ web/admin/members.php | 2 ++ web/admin/revoke.php | 1 + web/admin/services.php | 2 ++ web/admin/validate.php | 1 + web/helloasso/renew.php | 2 ++ web/inc/auth.php | 41 +++++++++++++++++++++++++++++++++++++++++ web/password.php | 2 ++ web/profile.php | 6 ++++++ web/register.php | 2 ++ 10 files changed, 62 insertions(+) diff --git a/web/admin/groups.php b/web/admin/groups.php index 0a64b27..f15959d 100644 --- a/web/admin/groups.php +++ b/web/admin/groups.php @@ -6,6 +6,7 @@ require_once __DIR__ . '/../inc/services.php'; session_start_safe(); require_admin(); +csrf_verifier(); $errors = []; $success = ''; @@ -97,6 +98,7 @@ require __DIR__ . '/../views/layout.php';
+ @@ -113,6 +115,7 @@ require __DIR__ . '/../views/layout.php';

Créer un groupe

+
diff --git a/web/admin/members.php b/web/admin/members.php index 5bfc1e2..38d57ee 100644 --- a/web/admin/members.php +++ b/web/admin/members.php @@ -58,6 +58,7 @@ require __DIR__ . '/../views/layout.php'; +