From 8a3a67d17595e90f378fcda4ef3066669a4f35aa Mon Sep 17 00:00:00 2001 From: Ferywir <65760459+Ferywir@users.noreply.github.com> Date: Tue, 23 Jun 2026 10:11:32 +0200 Subject: [PATCH] fix(admin): verify CSRF token in alliance/medal admin Mods [#139] (#261) editAli, delAli, medals, delallymedal, delallymedalbyaid, delallymedalbyweek and deletemedalbyweek are POSTed to directly, bypassing admin.php's central csrf_verify(). Add csrf_verify() (after the admin access check, via the shared GameEngine/Admin/csrf.php) and csrf_field() in their forms (playermedals.tpl, editAli.tpl, delAli.tpl, delmedal.tpl, allymedals.tpl, delallymedal.tpl). Co-authored-by: Claude Opus 4.8 --- Admin/Templates/allymedals.tpl | 2 ++ Admin/Templates/delAli.tpl | 1 + Admin/Templates/delallymedal.tpl | 1 + Admin/Templates/delmedal.tpl | 1 + Admin/Templates/editAli.tpl | 1 + Admin/Templates/playermedals.tpl | 2 ++ GameEngine/Admin/Mods/delAli.php | 5 +++++ GameEngine/Admin/Mods/delallymedal.php | 5 +++++ GameEngine/Admin/Mods/delallymedalbyaid.php | 5 +++++ GameEngine/Admin/Mods/delallymedalbyweek.php | 5 +++++ GameEngine/Admin/Mods/deletemedalbyweek.php | 5 +++++ GameEngine/Admin/Mods/editAli.php | 5 +++++ GameEngine/Admin/Mods/medals.php | 6 ++++++ 13 files changed, 44 insertions(+) diff --git a/Admin/Templates/allymedals.tpl b/Admin/Templates/allymedals.tpl index 206229b7..9b7e2837 100644 --- a/Admin/Templates/allymedals.tpl +++ b/Admin/Templates/allymedals.tpl @@ -63,6 +63,7 @@ $varmedal = $database->getProfileMedalAlly($_GET['aid']);
+ diff --git a/Admin/Templates/delallymedal.tpl b/Admin/Templates/delallymedal.tpl index e96f74d9..d7ca5871 100644 --- a/Admin/Templates/delallymedal.tpl +++ b/Admin/Templates/delallymedal.tpl @@ -63,6 +63,7 @@ $nummedals = $sql['Total']; + diff --git a/Admin/Templates/delmedal.tpl b/Admin/Templates/delmedal.tpl index f16b4fa9..6b62d538 100644 --- a/Admin/Templates/delmedal.tpl +++ b/Admin/Templates/delmedal.tpl @@ -64,6 +64,7 @@ $nummedals = $sql['Total']; +
diff --git a/Admin/Templates/editAli.tpl b/Admin/Templates/editAli.tpl index 85954b78..a7d69324 100644 --- a/Admin/Templates/editAli.tpl +++ b/Admin/Templates/editAli.tpl @@ -59,6 +59,7 @@ textarea{width:100%;box-sizing:border-box;min-height:120px;padding:8px;border:1p + diff --git a/Admin/Templates/playermedals.tpl b/Admin/Templates/playermedals.tpl index d77f1d0d..b1a30be6 100644 --- a/Admin/Templates/playermedals.tpl +++ b/Admin/Templates/playermedals.tpl @@ -56,6 +56,7 @@
+ '.csrf_field().'
Average Rank'.$average.'Delete All + '.csrf_field().'