Koha-clms/tools
Kyle M Hall 3d03eff4a4 Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files
The system is vulnerable to Formula Injection attacks as the data
stored within the database and exported as CSV/Excel is not being
sanitized or validated against implanted formula payloads

This patch modifies all uses of Text::CSV and derived classes to pass
the "formula" parameter with value of "empty" which replaces formulas
by empty string.

Test Plan:
1) Apply this patch
2) For guided_reports.pl, attempt to export CSV where you've set a column to a formula somehow
   ( such as "=1+3" )
3) Export that CSV file
4) Note the formula has not been exported
5) Repeat this plan for the remaining scripts that export CSV files
   where users can define the outputted data

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Fixed two conflicts. I have tested that this works as advertised on:
- Reports (Download > Comma separated text (.csv)) [Text::CSV::Encoded]
- Circulation > Overdues > Download file of all overdues [Text::CSV_XS]
- misc/export_borrowers.pl [Text::CSV]
This covers all modules used, and both GUI and command line.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Change none to empty in the commit message ! None is the default,
doing nothing. Empty clears the formulas.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-07 23:02:54 +00:00
..
csv-profiles
…
access_files.pl Bug 33341: Address some perlcritic errors in 5.36 2023-03-28 14:50:33 +02:00
additional-contents.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
ajax-inventory.pl Bug 37961: Inventory problem resolution fails by POSTing without an op or csrf_token 2024-10-09 21:54:02 +00:00
automatic_item_modification_by_age.pl Bug 36634: Replace cud-show with show in tools/automatic_item_modification_by_age.pl 2024-04-19 18:06:38 +02:00
batchMod.pl Bug 36326: Fix batch item mod/del access from biblio detail page 2024-03-22 12:26:36 +01:00
batch_delete_records.pl Bug 27893: Optionally skip biblio with open orders in batch delete 2024-04-19 18:06:32 +02:00
batch_extend_due_dates.pl Bug 37483: Use cud-list for extend due dates tool 2024-10-09 19:30:25 +00:00
batch_record_modification.pl Bug 34478: SQUASH Follow-up to previous batch operations patches 2024-03-01 11:00:05 +01:00
batch_records_ajax.pl Bug 34913: Adjust "Manage staged MARC records" 2024-01-26 15:13:43 +01:00
cleanborrowers.pl Bug 36526: Remove circular dependency from Koha::Objects 2024-05-03 16:02:44 +02:00
copy-holidays.pl Bug 34478: Changes for tools/holidays 2024-03-01 10:58:36 +01:00
csv-profiles.pl Bug 34478: Correct op name in CSV profile deletion confirmation step 2024-03-01 11:00:07 +01:00
exceptionHolidays.pl Bug 34478: Changes for tools/holidays 2024-03-01 10:58:36 +01:00
export.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
holidays.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
import_borrowers.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-07 23:02:54 +00:00
inventory.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-07 23:02:54 +00:00
letter.pl Bug 33237: Add display of which language default language is expected 2024-04-30 14:32:14 +02:00
manage-marc-import.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
marc_modification_templates.pl Bug 34478: Fixes for MARC modification template management 2024-03-01 11:00:05 +01:00
modborrowers.pl Bug 37612: Batch patron modification should accept both cud-show and show ops 2024-09-12 22:12:41 +00:00
newHolidays.pl Bug 34478: Changes for tools/holidays 2024-03-01 10:58:36 +01:00
overduerules.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
page.pl Bug 36875: Staff counterpart 2024-06-06 10:49:20 +02:00
picture-upload.pl Bug 37488: Validate paths in datalink.txt/idlink.txt files 2024-08-12 15:35:09 -03:00
problem-reports.pl Bug 34478: Manual fix - problem_reports 2024-03-01 10:56:59 +01:00
quotes-upload.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
quotes.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
scheduler.pl Bug 34478: (QA follow-up) Rename change to delete 2024-03-01 10:58:42 +01:00
showdiffmarc.pl Bug 31526: Follow-up for bug 29697 2022-09-16 10:25:48 -03:00
stage-marc-import.pl Bug 34478: Changes for tools/stage-marc-import 2024-03-01 10:58:40 +01:00
stockrotation.pl Bug 36193: cud- treatment for tools/stockrotation.pl 2024-03-12 17:47:33 +01:00
tools-home.pl Bug 33595: (bug 26628 follow-up) Fix authorization for tools-home.pl 2023-05-16 11:47:15 +02:00
upload-cover-image.pl Bug 34478: (follow-up) upload-cover-image.pl: Remove bitwise-and from condition 2024-03-01 10:59:56 +01:00
upload-file.pl Bug 28785: Adjust check_cookie_auth calls 2021-10-18 11:28:41 +02:00
upload.pl Bug 34478: Changes for tools/upload 2024-03-01 10:58:42 +01:00
viewlog.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-07 23:02:54 +00:00