Bugzilla – Attachment 66222 Details for
Bug 18956
Possible privacy breach with OPAC password recovery
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 18956: Leaking username/cardnumber or email
SIGNED-OFF-Bug-18956-Leaking-usernamecardnumber-or.patch (text/plain), 4.97 KB, created by
Katrin Fischer
on 2017-08-19 10:19:49 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 18956: Leaking username/cardnumber or email
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2017-08-19 10:19:49 UTC
Size:
4.97 KB
patch
obsolete
>From 4ee5b99924ea8bd049b74d27f17787ca4aa58f36 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Tue, 15 Aug 2017 16:16:16 +0000 >Subject: [PATCH] [SIGNED OFF] Bug 18956: Leaking username/cardnumber or email > >TEST PLAN > >correct login/cardnumber - emailed. >delete from borrower_password_recovery; >correct email - emailed. >delete from borrower_password_recovery; >correct login/cardnumber && correct email -- emailed. >delete from borrower_password_recovery; >wrong login/cardnumber - error page as expected >delete from borrower_password_recovery; >wrong login/cardnumber && correct email -- error page as expected >delete from borrower_password_recovery; >correct login/cardnumber && wrong email -- error page as expected >delete from borrower_password_recovery; >wrong login/cardnumber && wrong email -- error page as expected >delete from borrower_password_recovery; >empty -- INTERNAL SERVER ERROR?! >delete from borrower_password_recovery; > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../bootstrap/en/modules/opac-password-recovery.tt | 7 ++++++- > opac/opac-password-recovery.pl | 16 ++++++++++------ > 2 files changed, 16 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt >index 4f3f857..b16a33b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt >@@ -58,7 +58,12 @@ > Account identification with this email address only is ambiguous. > <br />Please use the field 'Login' as well. > [% ELSIF (errAlreadyStartRecovery) %] >- The process of password recovery has already been started for this account ("<strong>[% username %]</strong>") >+ The process of password recovery has already been started for this account >+ [% IF username %] >+ ("<strong>[% username %]</strong>") >+ [% ELSIF email %] >+ ("<strong>[% email %]</strong>") >+ [% END %] > <br/>You should have received an email with a link to reset your password. > <br/>If you did not receive this email, you can request a new one: <a href="/cgi-bin/koha/opac-password-recovery.pl?resendEmail=true&email=[% email %]&username=[% username %]">Get new password recovery link</a> > [% ELSIF (errPassNotMatch) %] >diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl >index d05a78c..052df7d 100755 >--- a/opac/opac-password-recovery.pl >+++ b/opac/opac-password-recovery.pl >@@ -31,7 +31,7 @@ my $repeatPassword = $query->param('repeatPassword'); > my $minPassLength = C4::Context->preference('minPasswordLength'); > my $id = $query->param('id'); > my $uniqueKey = $query->param('uniqueKey'); >-my $username = $query->param('username'); >+my $username = $query->param('username') // q{}; > my $borrower_number; > > #errors >@@ -53,7 +53,6 @@ my $errPassTooShort; > if ( $query->param('sendEmail') || $query->param('resendEmail') ) { > > #try with the main email >- $email ||= ''; # avoid undef > my $borrower; > my $search_results; > >@@ -65,7 +64,7 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { > $search_results = Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ); > } > >- if ( not $search_results || $search_results->count < 1) { >+ if ( ! defined $search_results || $search_results->count < 1) { > $hasError = 1; > $errNoBorrowerFound = 1; > } >@@ -78,7 +77,6 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { > $errMultipleAccountsForEmail = 1; > } > elsif ( $borrower = $search_results->next() ) { # One matching borrower >- $username ||= $borrower->userid; > my @emails = ( $borrower->email, $borrower->emailpro, $borrower->B_email ); > > my $firstNonEmptyEmail = ''; >@@ -93,12 +91,18 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { > $errNoBorrowerFound = 1; > } > >-# No email has been entered, no recovery possible >- elsif ( !$email ) { >+# If we dont have an email and one was not provided. >+ elsif ( !$email && !$firstNonEmptyEmail ) { > $hasError = 1; > $errNoBorrowerFound = 1; > } > >+# If we dont have an email and one was provided. >+ elsif ( !$email && $firstNonEmptyEmail ) { >+ $hasError = 1; >+ $errAlreadyStartRecovery = 1; >+ } >+ > # Check if a password reset already issued for this borrower AND we are not asking for a new email > elsif ( not $query->param('resendEmail') ) { > if ( ValidateBorrowernumber( $borrower->borrowernumber ) ) { >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18956
:
65105
|
66026
|
66221
|
66222
|
66491
|
66492
|
66972
|
66973
|
67107
|
67952