[Bug 44343] New: export_borrowers.pl exports password hashes and two-factor secrets by default, and an exported hash cannot be imported back
Import patrons uses), matchpoint cardnumber.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44343 Bug ID: 44343 Summary: export_borrowers.pl exports password hashes and two-factor secrets by default, and an exported hash cannot be imported back Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org CC: jake.deery@openfifth.co.uk, robin@catalyst.net.nz Target Milestone: --- misc/export_borrowers.pl with no --field exports every column of borrowers. That includes password (the bcrypt hash) and secret (the patron's two-factor authentication secret, in clear). Staff accounts are patrons, so a routine "export all patrons" CSV carries every staff member's 2FA secret and password hash to wherever the file goes. The hash is also no use in the file: patron import treats a password column as a plain password, so Koha::Patron->store hashes the hash again and the patron cannot log in. To reproduce (main 186bbe7): 1. Create a patron with userid k012user and password Koha-K012-pass1. 2. perl misc/export_borrowers.pl -H --where "borrowernumber=<that patron>" The header has password and secret; the line has $2a$08$... and the 2FA secret. 3. With a field list that includes password (so the file can be imported as it is), e.g. -f cardnumber -f surname -f firstname -f categorycode -f branchcode -f userid -f password, delete the patron and import the file with Koha::Patrons::Import (what Tools 4. The patron is created with a password column starting $2a$08$ (a hash of the hash) and logging in with Koha-K012-pass1 is refused. Expected: the default export leaves password and secret out; they are exported only when named with --field. (The all-fields file cannot be imported as it is on main for other reasons, see bug 31720 and bug 44282.) -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44343 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 212810 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212810&action=edit Bug 44343: Leave password and secret out of the default patron export Bug 44343: Leave password and secret out of the default patron export With no --field, export_borrowers.pl exported every borrowers column, including the password hash and the two-factor secret. Staff are patrons, so an "export all" file carried every staff member's 2FA secret. The hash cannot be used by an import either: patron import treats a password column as a plain password and hashes it again. Without --field the two columns are now left out. They are still exported when named with --field. Test plan: 1. perl misc/export_borrowers.pl -H --where "borrowernumber=<a patron with 2FA>" The header has password and secret. 2. Apply the patch and run it again: neither is in the header or the line. 3. Add -f cardnumber -f password: both are exported. 4. perl misc/export_borrowers.pl --help mentions the two columns. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44343 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44343 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31720, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=44282 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org