Koha-clms/misc/cronjobs
Kyle M Hall c9ffc538de 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>
(cherry picked from commit e588f810a521065bf46dc037edeac5c83d537714)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-11-05 15:43:13 +01:00
..
holds Bug 32565: (follow-up) Tidy 2024-05-24 14:13:40 +02:00
recalls Bug 33992: Only consider the date when auto-expiring problematic recalls 2023-07-19 12:06:50 -03:00
rss Bug 17600: Fix POSIX imports 2021-07-29 14:37:26 +02:00
social_data Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
thirdparty Bug 34854: (follow-up) Param name change + POD 2024-01-31 13:44:32 +01:00
CONFIGURE.gmail Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
advance_notices.pl Bug 34059: Add only issues from the branch that is creating the notice 2023-08-15 11:25:39 +03:00
archive_purchase_suggestions.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
automatic_checkin.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
automatic_item_modification_by_age.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
automatic_renewals.pl Bug 37552: (24.05.x) Wrap auto renewal attempt in eval to ensure script does not die 2024-09-17 16:06:32 +02:00
backup.sh
…
batch_anonymise.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
build_browser_and_cloud.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
cart_to_shelf.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
check-url-quick.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
cleanup_database.pl Bug 36526: Remove circular dependency from Koha::Objects 2024-05-24 14:59:19 +02:00
cloud-kw.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
cloud-sample.conf
…
create_koc_db.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
crontab.example Bug 28688: Add renewal to crontab example 2023-10-10 09:22:31 -03:00
debar_patrons_with_fines.pl Bug 15157: (QA follow-up) Some more changes 2023-11-08 11:41:30 -03:00
delete_items.pl Bug 33698: Add fields to the verbose output that show the barcode and title of items that cannot be deleted 2023-06-09 08:50:14 -03:00
delete_patrons.pl Bug 15504: (QA follow-up) Final changes 2023-10-24 10:05:23 -03:00
delete_records_via_leader.pl Bug 32656: Script delete_records_via_leader.pl no longer deletes items 2023-01-20 13:53:09 +00:00
edi_cron.pl Bug 16258: (QA follow-up) Capitalise EDIFACT 2022-04-13 15:55:39 +02:00
erm_run_harvester.pl Bug 34587: (QA follow-up) Tidy 2023-10-31 16:46:32 -03:00
fines.pl Bug 18855: Don't create duplicate overdue fines if an issue is returned 2023-07-06 10:08:44 -03:00
gather_print_notices.pl Bug 35373: Remove false FIXME comment from gather_print_notices.pl 2024-02-01 14:46:47 +01:00
import_webservice_batch.pl Bug 15869: Change framework on overlay 2023-02-07 10:32:22 -03:00
longoverdue.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
membership_expiry.pl Bug 35001: Add some checks to membership_expiry 2023-10-24 15:44:32 -03:00
merge_authorities.pl Bug 17600: Fix missing C4::AuthoritiesMARC import 2021-07-29 15:34:25 +02:00
notice_unprocessed_suggestions.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
overdue_notices.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 15:43:13 +01:00
patron_emailer.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
plugins_nightly.pl Bug 35479: (QA follow-up): Tidy 2024-02-13 11:24:17 +01:00
printoverdues.sh
…
process_message_queue.pl Bug 31345: Add ability to exit process_message_queue.pl early if any plugin before_send_messages hook fails 2024-05-24 14:08:44 +02:00
purge_suggestions.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
reconcile_balances.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
remove_temporary_edifiles.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
runreport.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 15:43:13 +01:00
serialsUpdate.pl Bug 28950: Mark serial late when past grace period 2022-10-11 10:42:26 -03:00
share_usage_with_koha_community.pl Bug 31203: Alter other cronjobs that currenlty use cronlogaction 2022-10-05 16:12:59 -03:00
sitemap.pl Bug 33871: Use Koha object in Sitemapper, add optional filter 2023-09-01 11:23:25 -03:00
staticfines.pl Bug 36787: staticfines.pl add use Koha::DateUtils::output_pref 2024-05-24 16:47:56 +02:00
stockrotation.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
update_patrons_category.pl Bug 31249: Use cronlogaction on update_patrons_category.pl 2022-08-05 11:53:15 -03:00
update_totalissues.pl Bug 37775: Spelling and tidy 2024-10-21 14:56:15 +02:00
writeoff_debts.pl Bug 34077: Allow to use --category-code as the only filter option 2024-07-19 09:34:52 +02:00