From 9ae62a9708c6d824107394a733fc148ce72b82f4 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 14 Sep 2017 11:52:08 -0400 Subject: [PATCH] Bug 19319 - Reflected XSS Vulnerability in opac-MARCdetail.pl Try going to this URL on your site: /cgi-bin/koha/opac-MARCdetail.pl?biblionumber=2"> Test Plan: 1) Go to /cgi-bin/koha/opac-MARCdetail.pl?biblionumber=2"> 2) Note is embedded all over the html 3) Apply this patch 4) Refresh the page, not the injection is gone! --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt | 12 ++++++------ opac/opac-MARCdetail.pl | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt index db570b3..d053aab 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt @@ -1,6 +1,6 @@ [% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] -[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › MARC details for record no. [% biblionumber | html %] +:title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › MARC details for record no. [% biblio.id %] [% INCLUDE 'doc-head-close.inc' %] [% BLOCK cssinclude %][% END %] @@ -20,14 +20,14 @@
- Normal view + Normal view MARC view - [% IF ( ISBD ) %]ISBD view[% END %] + [% IF ( ISBD ) %]ISBD view[% END %]
-

[% bibliotitle %] (Record no. [% biblionumber | html %])

+

[% bibliotitle %] (Record no. [% biblio.id %])

[% IF ( OPACXSLTDetailsDisplay ) %] - +
[% END %] @@ -190,7 +190,7 @@ $(document).ready(function(){ $(this).text(_("view labeled")); $("#labeledmarc").hide(); if(!loaded){ - $("#plainmarc").show().html("
"+_("Loading")+"...
").load("/cgi-bin/koha/opac-showmarc.pl","id=[% biblionumber | html %]&viewas=html"); + $("#plainmarc").show().html("
"+_("Loading")+"...
").load("/cgi-bin/koha/opac-showmarc.pl","id=[% biblio.id %]&viewas=html"); loaded = 1; } else { $("#plainmarc").show(); diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 9605cdd..334e383 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -349,7 +349,7 @@ $template->param( item_loop => \@item_loop, item_header_loop => \@item_header_loop, item_subfield_codes => \@item_subfield_codes, - biblionumber => $biblionumber, + biblio => $biblio, ); output_html_with_http_headers $query, $cookie, $template->output; -- 2.10.2