Koha-clms/misc/migration_tools
Kyle M Hall 96152682bf 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: wainuiwitikapark <wainuiwitikapark@catalyst.net.nz>
2024-11-05 22:46:12 +00:00
..
22_to_30 Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
ifla Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
buildCOUNTRY.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
buildEDITORS.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
buildLANG.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
build_oai_sets.pl Bug 32800: Don't embed items for deleted records 2023-04-12 09:26:50 -03:00
bulkmarcimport.pl Bug 25616: Uppercase hard coded lower case boolean operators for Elasticsearch 2022-02-24 14:35:36 -10:00
checkNonIndexedBiblios.pl Bug 28617: Remove kohalib.pl and rely on PERL5LIB 2021-12-07 12:16:28 -10:00
create_analytical_rel.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
import_lexile.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 22:46:12 +00:00
koha-svc.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
rebuild_zebra.pl Revert "Bug 15187: Index 880 in Zebra the same as Elasticsearch" 2022-10-24 14:03:44 -03:00
rebuild_zebra_sliced.sh Bug 13660: Exclude export phase and use existing exported MARCXML - rebuild_zebra_sliced.sh 2018-01-09 17:23:50 -03:00
remove_unused_authorities.pl Bug 30939: Fix use statement for DelAuthority 2022-06-28 09:39:24 -03:00
switch_marc21_series_info.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
upgradeitems.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00