From 51726c19525839ce33bdd7394eabf58fd4c719ee Mon Sep 17 00:00:00 2001 From: Robert Lyon Date: Tue, 12 Mar 2019 11:11:20 +1300 Subject: [PATCH] Security bug 1819547: Need to escape collection title on matrix page To avoid potential XSS vector behatnotneeded Change-Id: I00eb57f1421a0969f8da93ace6210f84c0830fa7 Signed-off-by: Robert Lyon --- htdocs/module/framework/matrix.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/module/framework/matrix.php b/htdocs/module/framework/matrix.php index a0f2a58dc0..3c7be339d1 100644 --- a/htdocs/module/framework/matrix.php +++ b/htdocs/module/framework/matrix.php @@ -37,7 +37,6 @@ if (!$collection->has_framework()) { // The collection does have a framework associated but we are not allowed // to see the matrix page so show an error page with link to first page of collection. $smarty = smarty(); - $smarty->assign('maintitle', $collection->get('name')); $smarty->assign('owner', $collection->get('owner')); $smarty->assign('PAGEHEADING', null); $smarty->assign('name', get_string('frameworkmissing', 'module.framework')); @@ -198,7 +197,7 @@ $inlinejs = <<assign('INLINEJAVASCRIPT', $inlinejs); -$smarty->assign('maintitle', $collection->get('name')); +$smarty->assign('maintitle', hsc($collection->get('name'))); $smarty->assign('collectionid', $collection->get('id')); $smarty->assign('owner', $owner); $smarty->assign('PAGEHEADING', null); -- GitLab