Koha/labels
Kyle M Hall 6b96763992
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: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 10:46:31 +01:00
..
barcode-print.pl Bug 29821: Add interface for generating barcodes using svc/barcode 2022-04-08 15:49:17 +02:00
label-create-csv.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-14 10:46:31 +01:00
label-create-pdf.pl Bug 10762: (QA follow-up) Perltidy 2023-10-25 10:35:31 -03:00
label-create-xml.pl Bug 36511: Some scripts missing a dependency following Bug 24879 2024-04-10 09:09:50 +02:00
label-edit-batch.pl Bug 37206: Removing an item from a label batch should be a CSRF-protected POST operation 2024-07-02 17:20:38 +02:00
label-edit-layout.pl Bug 34478: Update label ops 'edit' to 'edit_form' 2024-03-01 10:56:33 +01:00
label-edit-profile.pl Bug 34478: Update label ops 'edit' to 'edit_form' 2024-03-01 10:56:33 +01:00
label-edit-range.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
label-edit-template.pl Bug 34478: Update label ops 'edit' to 'edit_form' 2024-03-01 10:56:33 +01:00
label-home.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
label-item-search.pl Bug 36931: Fix label-item-search.pl by removing CSRF requirement 2024-05-24 15:36:46 +02:00
label-manage.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
label-print.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
spinelabel-home.pl Bug 28624: Remove Smart::Comments 2021-07-26 12:46:32 +02:00
spinelabel-print.pl Bug 31633: (follow-up) Group template params 2022-10-03 14:09:59 -03:00