From 6db738a87c44b8d96919191ba5e661c32ab47457 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 31 Jan 2026 11:40:58 +0100 Subject: [PATCH] Forum: Fix XSS in board name --- system/pages/forum/edit_post.php | 2 +- system/pages/forum/new_post.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/pages/forum/edit_post.php b/system/pages/forum/edit_post.php index a97bb5d9..6eff5804 100644 --- a/system/pages/forum/edit_post.php +++ b/system/pages/forum/edit_post.php @@ -36,7 +36,7 @@ if(Forum::canPost($account_logged)) { $thread = $db->query("SELECT `author_guid`, `author_aid`, `first_post`, `post_topic`, `post_date`, `post_text`, `post_smile`, `post_html`, `id`, `section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `id` = ".$post_id." LIMIT 1")->fetch(); if(isset($thread['id'])) { $first_post = $db->query("SELECT `" . FORUM_TABLE_PREFIX . "forum`.`author_guid`, `" . FORUM_TABLE_PREFIX . "forum`.`author_aid`, `" . FORUM_TABLE_PREFIX . "forum`.`first_post`, `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`post_text`, `" . FORUM_TABLE_PREFIX . "forum`.`post_smile`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $thread['first_post']." LIMIT 1")->fetch(); - echo 'Boards >> '.$sections[$thread['section']]['name'].' >> '.htmlspecialchars($first_post['post_topic']).' >> Edit post'; + echo 'Boards >> '.escapeHtml($sections[$thread['section']]['name']).' >> '.htmlspecialchars($first_post['post_topic']).' >> Edit post'; if(Forum::hasAccess($thread['section']) && ($account_logged->getId() == $thread['author_aid'] || Forum::isModerator())) { $char_id = $post_topic = $text = $smile = $html = null; diff --git a/system/pages/forum/new_post.php b/system/pages/forum/new_post.php index 71bc3417..a06183e8 100644 --- a/system/pages/forum/new_post.php +++ b/system/pages/forum/new_post.php @@ -42,7 +42,7 @@ if(Forum::canPost($account_logged)) { $thread = $db->query("SELECT `" . FORUM_TABLE_PREFIX . "forum`.`post_topic`, `" . FORUM_TABLE_PREFIX . "forum`.`id`, `" . FORUM_TABLE_PREFIX . "forum`.`section` FROM `" . FORUM_TABLE_PREFIX . "forum` WHERE `" . FORUM_TABLE_PREFIX . "forum`.`id` = ".(int) $thread_id." AND `" . FORUM_TABLE_PREFIX . "forum`.`first_post` = ".$thread_id." LIMIT 1")->fetch(); if(isset($thread['id']) && Forum::hasAccess($thread['section'])) { - echo 'Boards >> '.$sections[$thread['section']]['name'].' >> '.htmlspecialchars($thread['post_topic']).' >> Post new reply

'.htmlspecialchars($thread['post_topic']).'

'; + echo 'Boards >> '.escapeHtml($sections[$thread['section']]['name']).' >> '.htmlspecialchars($thread['post_topic']).' >> Post new reply

'.htmlspecialchars($thread['post_topic']).'

'; $quote = isset($_REQUEST['quote']) ? (int) $_REQUEST['quote'] : NULL; $text = isset($_POST['text']) ? stripslashes(trim($_POST['text'])) : NULL;