Bug 19079 - XSS Flaws in Membership page

1. Hit /cgi-bin/koha/members/moremember.pl?borrowernumber=xx<script>alert('amit')</script>.
   xx - is a borrowernumber
2. Notice the java script is executed.
4. Apply patch.
5. Reload page, and hit the page again /cgi-bin/koha/members/moremember.pl?borrowernumber=xx<script>alert('amit')</script>.
   xx - is a borrowernumber.
6. Notice it is no longer executed.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Amit Gupta 2017-08-11 21:08:14 +05:30 committed by Katrin Fischer
parent a6994fa928
commit 92a38358e0
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,7 @@
use strict;
#use warnings; FIXME - Bug 2505
use CGI qw ( -utf8 );
use HTML::Entities;
use C4::Context;
use C4::Auth;
use C4::Output;
@ -114,6 +115,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
}
);
my $borrowernumber = $input->param('borrowernumber');
$borrowernumber = HTML::Entities::encode($borrowernumber);
my $error = $input->param('error');
$template->param( error => $error ) if ( $error );