Koha/C4
Jonathan Druart 167fff1aa8
Bug 36520: Prevent SQL injection in GetPreparedLetter
Actually in _get_tt_params

The following query will delay the response

SELECT `me`.`biblionumber`, `me`.`frameworkcode`, `me`.`author`, `me`.`title`, `me`.`medium`, `me`.`subtitle`, `me`.`part_number`, `me`.`part_name`, `me`.`unititle`, `me`.`notes`, `me`.`serial`, `me`.`seriestitle`
, `me`.`copyrightdate`, `me`.`timestamp`, `me`.`datecreated`, `me`.`abstract`
  FROM `biblio` `me`
WHERE `biblionumber` = '1) AND (SELECT 1 FROM (SELECT(SLEEP(6)))x)-- -'
ORDER BY field( biblionumber, 1 ) AND (
    SELECT 1
      FROM
    SELECT SLEEP( 6 ) x
   ) -- - )

To test
1/ Add some items to your cart in the opac
2/ Choose send cart
3/ Open firefox developer tools and switch to the network tab
4/ Send cart
5/ In the network tab, find the post request and choose copy as curl
6/ Edit the curl command to add )+AND+(SELECT+1+FROM+(SELECT(SLEEP(6)))x)--+-  to the bib_list parameter
7/ Run the curl notice it takes a long time to respond, if you want to check run the curl without the above part added
8/ Apply the patch and restart plack
9/ Run the modified curl and notice no longer the slow down
10/ Test in browser and make sure the basket is still sent

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-06-20 17:55:35 +02:00
..
AuthoritiesMarc
Barcodes
ClassSortRoutine
ClassSplitRoutine
Creators
External
Form Bug 30318: Don't reset messaging preferences when form is empty 2024-04-26 08:52:51 +02:00
Heading Bug 36917: (follow-up) Remove Elasticsearch warnings and tidy 2024-05-24 15:36:42 +02:00
ILSDI Bug 36453: Update old occurrences of effective_BlockExpiredPatronOpacActions 2024-06-11 09:17:18 +01:00
Installer
Labels
Linker
Members
OAI
Output
Patroncards
Reports Bug 35907: Tidy execute_query 2024-05-10 16:45:45 +02:00
Search
Serials
SIP Bug 36948: (follow-up) Allow IPv[46] in port config 2024-06-11 08:10:01 +01:00
Utils/DataTables
Accounts.pm
Acquisition.pm Bug 36002: Remove unused subroutine GetParcels 2024-04-30 17:09:43 +02:00
Auth.pm Bug 36575: (QA follow-up) Shibboleth POD and checkpw_internal call 2024-06-20 17:55:34 +02:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm
Auth_with_ldap.pm Bug 36575: (bug 34893 follow-up) Return patron from LDAP 2024-06-20 17:55:32 +02:00
Auth_with_shibboleth.pm Bug 36575: (QA follow-up) Shibboleth POD and checkpw_internal call 2024-06-20 17:55:34 +02:00
AuthoritiesMarc.pm Bug 35989: (QA follow-up): Fix QA tests 2024-06-06 15:18:43 +01:00
Barcodes.pm
Biblio.pm Bug 36137: Make update_totalissues cron always skip the holds queue 2024-05-03 18:02:15 +02:00
Breeding.pm
Budgets.pm
Calendar.pm
Charset.pm
Circulation.pm Bug 36453: Update old occurrences of effective_BlockExpiredPatronOpacActions 2024-06-11 09:17:18 +01:00
ClassSortRoutine.pm
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 36367: Set to undef when unsetting 2024-06-14 11:17:18 +01:00
Contract.pm
CourseReserves.pm
Creators.pm
Heading.pm Bug 30047: (follow-up) Fix failing tests 2024-05-13 16:24:18 +02:00
HoldsQueue.pm Bug 32565: (follow-up) Tidy 2024-04-30 14:32:07 +02:00
HTML5Media.pm
ImportBatch.pm
ImportExportFramework.pm
InstallAuth.pm Bug 36367: Remove _new_userenv 2024-06-14 11:17:17 +01:00
Installer.pm
ItemCirculationAlertPreference.pm
Items.pm Bug 19097: Adjust some GetMarcFromKohaField calls 2024-04-29 09:35:47 +02:00
Koha.pm Bug 36750: Use the same label for Zebra 2024-05-07 17:41:19 +02:00
Labels.pm
Languages.pm Bug 35582: Supress possible warning 2024-04-29 18:53:13 +02:00
Letters.pm Bug 36520: Prevent SQL injection in GetPreparedLetter 2024-06-20 17:55:35 +02:00
Linker.pm
Log.pm Bug 25159: (QA follow-up) Tidy changes 2024-05-02 16:47:44 +02:00
MarcModificationTemplates.pm
Matcher.pm
Members.pm
Message.pm
Output.pm
Overdues.pm
Patroncards.pm
Record.pm
Reports.pm
Reserves.pm Bug 34972: Remove GetOtherReserves 2024-05-07 15:53:42 +02:00
Ris.pm
RotatingCollections.pm
Scheduler.pm
Scrubber.pm Bug 36328: (QA follow-up) Expand tests and reorder elements to clarify differences 2024-04-22 12:39:20 +02:00
Search.pm Bug 35138: Add the ability to manage ES facets 2024-04-30 12:00:56 +02:00
Serials.pm Bug 36939: Remove a warning from Serials.t 2024-05-24 15:36:47 +02:00
Service.pm
ShelfBrowser.pm
SMS.pm
SocialData.pm
Stats.pm
Suggestions.pm Bug 35597: Move modification logging to Koha::Suggestion 2024-06-13 14:08:33 +01:00
Tags.pm Bug 36785: Typo unreconized and bilbio in tags code 2024-05-17 10:36:35 +02:00
Templates.pm
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 26176: (QA follow-up) Branch -> Library 2024-05-23 17:51:18 +02:00
XISBN.pm
XSLT.pm