Bugzilla – Attachment 191239 Details for
Bug 41593
Authenticated SQL Injection in staff side suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41593: Validate displayby parameter in suggestion.pl
Bug-41593-Validate-displayby-parameter-in-suggesti.patch (text/plain), 1.79 KB, created by
David Cook
on 2026-01-11 23:42:35 UTC
(
hide
)
Description:
Bug 41593: Validate displayby parameter in suggestion.pl
Filename:
MIME Type:
Creator:
David Cook
Created:
2026-01-11 23:42:35 UTC
Size:
1.79 KB
patch
obsolete
>From 3142b2e486b3b3e573041e41adbf47e55ab55d1e Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Sun, 11 Jan 2026 23:38:38 +0000 >Subject: [PATCH] Bug 41593: Validate displayby parameter in suggestion.pl > >This change validates the displayby parameter in suggestion.pl >in order to prevent SQL injection. > >Test plan: >0. Do not apply the patch >1. Log into the staff interface >2. Visit the path /cgi-bin/koha/suggestion/suggestion.pl? >op=else&displayby=status+AND+EXTRACTVALUE(1,CONCAT(0x7e,@@version)) >3. Notice a 500 error is generated >4. In the error logs, the MySQL version number will appear > >5. Apply the patch >6. koha-plack --restart kohadev > >7. Visit the path /cgi-bin/koha/suggestion/suggestion.pl? >op=else&displayby=status+AND+EXTRACTVALUE(1,CONCAT(0x7e,@@version)) >8. Notice that no error is generated >9. Try each of the "Organize by" options on the left nav bar >10. Note that none of them generate an error and that the option is >retained after clicking "Go" >--- > suggestion/suggestion.pl | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 249ae1843b7..f1c5c8061ee 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -103,6 +103,18 @@ my $filter_archived = $input->param('filter_archived') || 0; > my $new_itemtype = $input->param('suggestion_itemtype'); > my $sugg_managedby = $input->param('suggestion_managedby'); > >+#NOTE: Validate displayby as it gets passed to sensitive functions >+my %valid_displayby = ( >+ STATUS => 1, >+ branchcode => 1, >+ itemtype => 1, >+ managedby => 1, >+ acceptedby => 1, >+); >+if ( !$valid_displayby{$displayby} ) { >+ $displayby = ''; >+} >+ > my $reasonsloop = GetAuthorisedValues("SUGGEST"); > > my $suggestion_ref = { $input->Vars }; >-- >2.39.5
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 41593
:
191239
|
191249
|
191250
|
191576
|
191577
|
191578
|
191696