Koha-clms/misc
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
..
admin
…
bin Bug 23241: Remove unused koha-index-daemon-ctl.sh 2023-10-10 09:22:37 -03:00
cronjobs Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 15:43:13 +01:00
devel Bug 35536: Refine verbose handling in some Koha::Plugins calls 2024-07-22 14:00:11 +02:00
interface_customization
…
maintenance Bug 37037: (RM follow-up) Add hint at end of script run 2024-07-17 16:11:55 +02:00
migration_tools Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 15:43:13 +01:00
release_notes Update release notes for 23.11.09 release 2024-10-03 12:16:10 +02:00
search_tools Bug 35345: Add --where option to rebuild_elasticsearch.pl 2024-05-23 16:49:25 +02:00
translator Bug 36845: Do not loop over the content attribute 2024-05-29 15:56:06 +02:00
workers Bug 33898: Implement reaping for database polling 2024-03-18 09:56:02 +01:00
add_date_fields_to_marc_records.pl Bug 23924: Reset the fields to add 2023-05-05 12:13:53 -03:00
add_statistics_borrowers_categorycode.pl Bug 32922: Remove space in shebang 2023-02-20 09:44:06 -03:00
batchCompareMARCvsFrameworks.pl
…
batchDeleteUnusedSubfields.pl
…
batchImportMARCWithBiblionumbers.pl
…
batchRebuildBiblioTables.pl
…
batchRebuildItemsTables.pl
…
batchRepairMissingBiblionumbers.pl
…
batchdeletebiblios.pl
…
check_sysprefs.pl
…
commit_file.pl Bug 15869: Change framework on overlay 2023-02-07 10:32:22 -03:00
export_borrowers.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 15:43:13 +01:00
export_records.pl Bug 31286: Embed see-from headings into bibliographic records export 2024-05-23 10:39:39 +02:00
exportauth.pl
…
import_patrons.pl Bug 34621: Tidy import_patrons.pl 2024-05-23 14:56:02 +02:00
koha-install-log
…
link_bibs_to_authorities.pl Bug 30024: Make link_bibs_to_authorities.pl rely on LinkerRelink 2023-11-03 14:22:45 -03:00
load_yaml.pl
…
mod_zebraqueue.pl
…
process_ill_updates.pl
…
recreateIssueStatistics.pl
…
sax_parser_print.pl
…
sax_parser_test.pl
…
sip_cli_emulator.pl Bug 34764: Set fee_acknowledged to expect a string 2023-09-15 11:57:10 -03:00
stage_file.pl
…
z3950_responder.pl
…