Bug 23058: Prevent XSS vulnerabiliies when 'tag' is passed to opac-search
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 5 Jun 2019 23:40:54 +0000 (18:40 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 2 Jul 2019 07:57:15 +0000 (08:57 +0100)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

opac/opac-search.pl

index c39ad59..84714a6 100755 (executable)
@@ -607,7 +607,7 @@ my $results_hashref;
 my @coins;
 
 if ($tag) {
-    $query_cgi = "tag=" .$tag . "&" . $query_cgi;
+    $query_cgi = "tag=" .  uri_escape_utf8( $tag ) . "&" . $query_cgi;
     my $taglist = get_tags({term=>$tag, approved=>1});
     $results_hashref->{biblioserver}->{hits} = scalar (@$taglist);
     my @marclist = map { C4::Biblio::GetXmlBiblio( $_->{biblionumber} ) } @$taglist;