From c3c474a5b70f9fb4bb368b5b58c623b1c9e2fc16 Mon Sep 17 00:00:00 2001 From: dvz Date: Sat, 19 Nov 2022 20:03:36 +0100 Subject: [PATCH] Fix Attachment upload XSS --- inc/functions_upload.php | 2 +- install/resources/mybb_theme.xml | 4 ++-- jscripts/post.js | 11 +++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/inc/functions_upload.php b/inc/functions_upload.php index bbfcab78ee..ed27b2325d 100644 --- a/inc/functions_upload.php +++ b/inc/functions_upload.php @@ -823,7 +823,7 @@ function add_attachments($pid, $forumpermissions, $attachwhere, $action=false) } else if(isset($attachedfile['aid']) && $mybb->get_input('ajax', MyBB::INPUT_INT) == 1) { - $ret['success'][] = array($attachedfile['aid'], get_attachment_icon(get_extension($filename)), $filename, get_friendly_size($FILE['size'])); + $ret['success'][] = array($attachedfile['aid'], get_attachment_icon(get_extension($filename)), htmlspecialchars_uni($filename), get_friendly_size($FILE['size'])); } } } diff --git a/install/resources/mybb_theme.xml b/install/resources/mybb_theme.xml index e981364b81..7b11d78374 100644 --- a/install/resources/mybb_theme.xml +++ b/install/resources/mybb_theme.xml @@ -9606,7 +9606,7 @@ if(use_xmlhttprequest == "1") ]]> -