Add CSRF Checks to notifications and ensure the user dismissing the notification is their own notification

This commit is contained in:
johnnyq
2026-03-05 17:51:20 -05:00
parent a81edc122d
commit 30357b9cf7
2 changed files with 4 additions and 2 deletions

View File

@@ -141,7 +141,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<td><?php echo $notification_dismissed_at; ?></td>
<?php } ?>
<?php if(!$dismissed_filter) { ?>
<td class="text-center"><a class="btn btn-secondary btn-sm" href="post.php?dismiss_notification=<?php echo $notification_id; ?>" title="Dismiss"><i class="fas fa-check"></i></a></td>
<td class="text-center"><a class="btn btn-secondary btn-sm" href="post.php?dismiss_notification=<?= $notification_id ?>&csrf_token=<?= $_SESSION['csrf_token'] ?>" title="Dismiss"><i class="fas fa-check"></i></a></td>
<?php } ?>
</tr>