Bug 17038: Fix XSS in catalogue/search.pl
Test plan: Search for something like: \";alert(1)//135 => Without this patch you will see the alert => With this patch, no more alert Note that this fix the parameters idx, q and op Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
96a9c2715e
commit
b543fa74fe
|
|
@ -152,7 +152,7 @@ $('#sort_by').change(function() {
|
|||
$(".selection").show();
|
||||
[% IF ( query_desc ) %]
|
||||
toHighlight = $("p,span.results_summary,a.title");
|
||||
var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
|
||||
var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
|
||||
q_array = query_desc.split(" ");
|
||||
// ensure that we don't have "" at the end of the array, which can
|
||||
// break the highlighter
|
||||
|
|
|
|||
Loading…
Reference in New Issue