Koha-clms/reports
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
..
acquisitions_stats.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
bor_issues_top.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
borrowers_out.pl Bug 28967: Patrons with no checkouts report shows patrons from other libraries with IndependentBranches 2022-10-17 08:10:59 -03:00
borrowers_stats.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
cash_register_stats.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 22:46:12 +00:00
cat_issues_top.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
catalog_by_itemtype.pl Bug 31988: Remove reports/itemtypes.plugin 2024-03-26 15:54:33 +00:00
catalogue_out.pl Bug 32588: Make filters on 'items with no checkouts' report translatable 2023-01-31 10:59:33 -03:00
catalogue_stats.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
dictionary.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
guided_reports.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 22:46:12 +00:00
issues_avg_stats.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
issues_stats.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
itemslost.pl Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 22:46:12 +00:00
orders_by_fund.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
reports-home.pl Bug 34859: Remove unnecessary params from reports-home.pl 2023-10-05 14:52:14 -10:00
reserves_stats.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
serials_stats.pl Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00