Koha-clms/C4
Jonathan Druart 7f926d6c75 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>
(cherry picked from commit 0b3c98b0ba01ea5c886ecfe8eef174b5b7c6ec25)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-06-06 10:59:48 +02:00
..
AuthoritiesMarc
…
Barcodes
…
ClassSortRoutine
…
ClassSplitRoutine
…
Creators Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
External
…
Form Bug 30318: Don't reset messaging preferences when form is empty 2024-05-23 16:59:36 +02:00
Heading Bug 21828: build $bib_heading_fields only once per invocation 2023-09-22 12:57:46 -03:00
ILSDI Bug 36335: Fix ILS-DI GetRecords bad encoding for UNIMARC 2024-05-29 11:21:32 +02:00
Installer
…
Labels Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
Linker
…
Members Bug 33239: Add the ability to run borrowers-force-messaging-defaults.pl only on a specified message name 2023-10-11 10:31:46 -03:00
OAI
…
Output
…
Patroncards Bug 34532: Silence warns in Patroncard.pm 2023-09-15 11:57:08 -03:00
Reports Bug 33046: Use process_tt in C4::Reports::Guided::EmailReport 2023-07-18 14:07:41 -03:00
SIP Bug 36676: SIP2 drops connection on unknown patron id in fee paid message 2024-05-29 10:35:38 +02:00
Search
…
Serials
…
Utils/DataTables Bug 34913: Fix perlcritic for VirtualShelves.pm 2024-01-31 13:49:30 +01:00
Accounts.pm
…
Acquisition.pm Bug 14092: (QA follow-up) Avoid fiddling with the hash in the template 2023-10-20 16:31:15 -03:00
Auth.pm Bug 36575: (QA follow-up) Shibboleth POD and checkpw_internal call 2024-06-06 10:59:48 +02:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm Bug 34893: (QA follow-up) Tidy code for qa script 2024-01-29 10:15:53 +01:00
Auth_with_ldap.pm Bug 36575: (bug 34893 follow-up) Return patron from LDAP 2024-06-06 10:59:48 +02:00
Auth_with_shibboleth.pm Bug 36575: (QA follow-up) Shibboleth POD and checkpw_internal call 2024-06-06 10:59:48 +02:00
AuthoritiesMarc.pm Bug 29522: [alternate] Skip relinking bibliographic records when merging authorities 2024-03-18 10:29:21 +01:00
Barcodes.pm
…
Biblio.pm Bug 36137: Make update_totalissues cron always skip the holds queue 2024-05-24 15:11:46 +02:00
Breeding.pm Bug 28166: (QA follow-up) Fix and tidy tests and code 2023-10-23 11:33:50 -03:00
Budgets.pm Bug 31631: Optionally use tax-exclusive values for calculating fund values 2023-10-18 15:41:35 -03:00
Calendar.pm Bug 32048: Added clear cache routine to delete_holiday_range_repeatable 2023-09-18 15:31:50 -03:00
Charset.pm
…
Circulation.pm Bug 30324: Don't use default rule if we have a parent rule 2024-05-24 10:57:37 +02:00
ClassSortRoutine.pm
…
ClassSource.pm
…
ClassSplitRoutine.pm
…
Context.pm Bug 36793: Fix case of $var in Context->delete_preference 2024-05-29 15:11:02 +02:00
Contract.pm
…
CourseReserves.pm
…
Creators.pm
…
HTML5Media.pm
…
Heading.pm Bug 33557: Add LinkerConsiderThesaurus system preference 2023-05-10 15:26:26 -03:00
HoldsQueue.pm Bug 32565: (follow-up) Tidy 2024-05-24 14:13:40 +02:00
ImportBatch.pm Bug 35438: Remove skip_intermediate_commit parameter 2024-01-17 10:30:13 +01:00
ImportExportFramework.pm
…
InstallAuth.pm
…
Installer.pm Bug 34174: (bug 33341 follow-up) Fix Ris export 2023-07-06 12:24:12 -03:00
ItemCirculationAlertPreference.pm
…
Items.pm Bug 32029: Automatic item modifications by age add biblio table 2024-03-11 11:16:47 +01:00
Koha.pm Bug 35833: Fix warnings from C4/Koha 2024-02-01 15:06:57 +01:00
Labels.pm
…
Languages.pm Bug 35582: Supress possible warning 2024-05-24 14:03:30 +02:00
Letters.pm Bug 36520: Prevent SQL injection in GetPreparedLetter 2024-06-06 10:59:48 +02:00
Linker.pm
…
Log.pm Bug 32057: (QA follow-up) Remove pretty flag 2023-03-14 08:49:34 -03:00
MarcModificationTemplates.pm
…
Matcher.pm Bug 26611: Make authority record matching use required match checks 2023-05-24 11:21:31 -03:00
Members.pm Bug 26170: Add protected status for patrons 2023-11-01 17:23:06 -03:00
Message.pm Bug 18398: (follow-up) Update POD & Unit tests 2023-03-31 13:13:35 +02:00
Output.pm Bug 30524: Core CSRF checking code 2023-08-07 20:59:58 -03:00
Overdues.pm Bug 34279: Don't enforce overduefinescap unless it is greater than 0 2023-07-19 13:00:41 -03:00
Patroncards.pm
…
Record.pm Bug 35588: Scope authorised value desc lookup according to field/subfield 2024-01-03 17:05:14 +01:00
Reports.pm
…
Reserves.pm Bug 34972: Remove GetOtherReserves 2024-05-22 14:44:24 +02:00
Ris.pm Bug 34174: (bug 33341 follow-up) Fix Ris export 2023-07-06 12:24:12 -03:00
RotatingCollections.pm Bug 31735: Avoid re-fetcing objects from database by passing them directly instead of ids to various subroutines 2023-05-12 12:40:21 -03:00
SMS.pm Bug 36307: SMS::Send driver errors are not captured and stored 2024-05-23 14:02:52 +02:00
Scheduler.pm
…
Scrubber.pm Bug 36328: (QA follow-up) Expand tests and reorder elements to clarify differences 2024-04-24 07:36:20 +02:00
Search.pm Bug 35833: Silence few warnings from searching 2024-02-01 15:06:57 +01:00
Serials.pm Bug 36939: Remove a warning from Serials.t 2024-05-30 10:20:04 +02:00
Service.pm
…
ShelfBrowser.pm
…
SocialData.pm Bug 33833: Add two FIXMEs to SocialData::get_report 2023-09-05 14:35:35 -03:00
Stats.pm Bug 33608: (QA follow-up) Remove ->insert method 2023-10-25 11:07:59 -03:00
Suggestions.pm Bug 33236: (follow-up) Remove export of NewSuggestion 2023-06-06 10:08:36 -03:00
TTParser.pm
…
Tags.pm Bug 36785: Typo unreconized and bilbio in tags code 2024-05-29 15:12:56 +02:00
Templates.pm Bug 35070: Tidy 2024-01-08 15:18:37 +01:00
TmplToken.pm
…
TmplTokenType.pm
…
UsageStats.pm Bug 26176: (QA follow-up) Branch -> Library 2024-06-06 10:53:04 +02:00
XISBN.pm
…
XSLT.pm Bug 33217: Tidy 2023-11-08 17:52:42 -03:00