Skip to content

Commit

Permalink
Bug 19258: Prevent warns when writing off an individual fine
Browse files Browse the repository at this point in the history
The following warns are triggered when I click the Write Off button next
to an individual fine or charge:
CGI::param called in list context from package
CGI::Compile::ROOT::home_vagrant_kohaclone_members_pay_2epl line 171,
this can lead to vulnerabilities. See the warning in "Fetching the
value or values of a single named parameter" at
/usr/share/perl5/CGI.pm line 436. (this shows many times)
Use of uninitialized value in subroutine entry at
/usr/share/perl5/URI/Escape.pm line 184.

To test:
1) Go to a members detail page in staff side and create a manual
invoice
2) Go to the pay fines tab, click the Write off button next to the
invoice you just created
3) Notice warns
4) Apply patch and repeat steps 1 & 2
5) Warns should be gone

Sponsored-by: Catalyst IT

Signed-off-by: Mark Tompsett <[email protected]>

Signed-off-by: Jonathan Druart <[email protected]>

Signed-off-by: Jonathan Druart <[email protected]>
  • Loading branch information
aleishaa authored and joubu committed Sep 7, 2017
1 parent 9ffda7a commit 693cc11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions members/pay.pl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ sub add_accounts_to_template {
sub get_for_redirect {
my ( $name, $name_in, $money ) = @_;
my $s = q{&} . $name . q{=};
my $value = uri_escape_utf8( $input->param($name_in) );
my $value;
if (defined $input->param($name_in)) {
$value = uri_escape_utf8( scalar $input->param($name_in) );
}
if ( !defined $value ) {
$value = ( $money == 1 ) ? 0 : q{};
}
Expand Down Expand Up @@ -196,7 +199,7 @@ sub redirect_to_paycollect {
$redirect .= get_for_redirect( 'notify_id', "notify_id$line_no", 0 );
$redirect .= get_for_redirect( 'notify_level', "notify_level$line_no", 0 );
$redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
$redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( $input->param("payment_note_$line_no") );
$redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( scalar $input->param("payment_note_$line_no") );
$redirect .= '&remote_user=';
$redirect .= $user;
return print $input->redirect($redirect);
Expand Down

0 comments on commit 693cc11

Please sign in to comment.