Skip to content

Commit 03fdedf

Browse files
committed
SECURITY: fix XSS vulnerability. fixes dokuwiki#4512
The namespace selector in the advanced search tools did not correctly escape the user provided namespace. This issue was reported by Mario Tesoro.
1 parent 68b76ef commit 03fdedf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inc/Ui/Search.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ protected function addNamespaceSelector(Form $searchForm)
302302
$currentWrapper = $searchForm->addTagOpen('div')->addClass('current');
303303
if ($baseNS) {
304304
$currentWrapper->addClass('changed');
305-
$searchForm->addHTML('@' . $baseNS);
305+
$searchForm->addHTML('@' . hsc($baseNS));
306306
} else {
307307
$searchForm->addHTML($lang['search_any_ns']);
308308
}
@@ -323,7 +323,7 @@ protected function addNamespaceSelector(Form $searchForm)
323323

324324
foreach ($extraNS as $ns => $count) {
325325
$listItem = $searchForm->addTagOpen('li');
326-
$label = $ns . ($count ? " <bdi>($count)</bdi>" : '');
326+
$label = hsc($ns) . ($count ? " <bdi>($count)</bdi>" : '');
327327

328328
if ($ns === $baseNS) {
329329
$listItem->addClass('active');

0 commit comments

Comments
 (0)