Bugzilla – Attachment 89453 Details for
Bug 22478
Cross-site scripting vulnerability in paginations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22478: (follow-up) [18.05.X ONLY] Fix rebase and fix selenium opac_auth
Bug-22478-follow-up-1805X-ONLY-Fix-rebase-and-fix-.patch (text/plain), 2.33 KB, created by
Nick Clemens (kidclamp)
on 2019-05-07 18:03:54 UTC
(
hide
)
Description:
Bug 22478: (follow-up) [18.05.X ONLY] Fix rebase and fix selenium opac_auth
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-05-07 18:03:54 UTC
Size:
2.33 KB
patch
obsolete
>From 6a5e5c7c0ea37b7e233bb74ee1dc88def1801ecb Mon Sep 17 00:00:00 2001 >From: root <root@f1ebe1bec408> >Date: Tue, 7 May 2019 18:01:45 +0000 >Subject: [PATCH] Bug 22478: (follow-up) [18.05.X ONLY] Fix rebase and fix > selenium opac_auth > >We missed a case or two in the backport, also picked changes from >https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76414&action=diff >in order to fix opac auth in selenium >--- > t/db_dependent/selenium/regressions.t | 7 +++++-- > t/lib/Selenium.pm | 5 ++--- > 2 files changed, 7 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/selenium/regressions.t b/t/db_dependent/selenium/regressions.t >index cba2bf0f45..68a121b890 100644 >--- a/t/db_dependent/selenium/regressions.t >+++ b/t/db_dependent/selenium/regressions.t >@@ -25,7 +25,7 @@ use Test::MockModule; > use C4::Context; > use C4::Biblio qw( AddBiblio ); > use C4::Circulation; >-use Koha::AuthUtils; >+use Koha::AuthUtils qw(hash_password); > use t::lib::Selenium; > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -187,8 +187,11 @@ subtest 'XSS vulnerabilities in pagination' => sub { > } > > my $password = Koha::AuthUtils::generate_password(); >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("UPDATE borrowers SET password = ? WHERE borrowernumber=?"); > t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 ); >- $patron->set_password({ password => $password }); >+ my $clave = hash_password( $password ); >+ $sth->execute( $clave, $patron->borrowernumber ); > $s->opac_auth( $patron->userid, $password ); > > my $public_lists = $s->opac_base_url . q|opac-shelves.pl?op=list&category=2|; >diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm >index 1a932a1abf..29f7ef4700 100644 >--- a/t/lib/Selenium.pm >+++ b/t/lib/Selenium.pm >@@ -106,13 +106,12 @@ sub opac_auth { > > $login ||= $self->login; > $password ||= $self->password; >- my $mainpage = $self->base_url . 'opac-main.pl'; >+ my $mainpage = $self->opac_base_url . 'opac-main.pl'; > > $self->driver->get($mainpage . q|?logout.x=1|); # Logout before, to make sure we will see the login form > $self->driver->get($mainpage); > $self->fill_form( { userid => $login, password => $password } ); >- my $login_button = $self->driver->find_element('//input[@id="submit"]'); >- $login_button->submit(); >+ $self->submit_form; > } > > sub fill_form { >-- >2.11.0
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 22478
:
86636
|
86683
|
87697
|
87698
|
87699
|
87700
|
87701
|
87841
|
87842
|
87843
|
87844
|
88937
|
88954
|
89002
|
89003
|
89004
|
89005
|
89006
|
89009
| 89453