Koha-clms/t
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
..
Acquisition
…
Biblio
…
Budgets
…
Circulation
…
External
…
Koha Bug 37018: Unit tests 2024-07-23 04:42:51 +00:00
Members
…
Number
…
SIP
…
Search Bug 34969: Remove unneeded module from buildQuery.t 2023-10-05 10:07:09 -10:00
Serials
…
Test
…
cypress Bug 36774: Add cypress tests 2024-05-28 21:54:33 +00:00
data Bug 31393: Koha::Config: handle the special case for 'content' attribute 2023-11-07 22:14:09 -10:00
db_dependent Bug 33339: Prevent Formula Injection (CSV Injection) in CSV files 2024-11-05 22:46:12 +00:00
edi_testfiles Bug 35398: Unit test 2024-03-19 15:21:43 +00:00
etc
…
lib Bug 34913: Fix a selenium test 2024-03-19 19:19:13 +00:00
00-check-atomic-updates.t Bug 31479: Option to skip t/00-check-atomic-updates.t when building custom packages 2023-05-10 15:26:20 -03:00
00-deprecated.t
…
00-load.t
…
00-merge-conflict-markers.t
…
00-testcritic.t Bug 34911: Test files from HEAD instead of 'master' 2023-10-05 09:38:43 -10:00
00-valid-xml.t
…
Auth.t
…
AuthoritiesMarc_MARC21.t Bug 31023: Unit tests 2022-09-07 13:52:35 -07:00
AuthoritiesMarc_UNIMARC.t
…
Barcodes_EAN13.t
…
Barcodes_annual.t
…
Barcodes_hbyymmincr.t
…
Barcodes_incremental.t
…
Biblio.t Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
Biblio2.t
…
Budgets.t
…
Charset.t
…
Circulation_barcodedecode.t Bug 30409: (QA follow-up) Avoid uninitialized variable warnings 2022-06-14 08:26:58 -03:00
ClassSortRoutine.t
…
ClassSortRoutine_Dewey.t
…
ClassSortRoutine_Generic.t
…
ClassSortRoutine_LCC.t
…
ClassSource.t
…
Context.t Bug 32478: (QA follow-up) Keep current hashref behavior 2023-06-09 16:05:07 -03:00
Contract.t
…
CookieManager.t Bug 31250: (QA follow-up) The future will be easier 2022-09-12 15:34:11 -03:00
Creators.t
…
DateUtils.t Bug 36432: Remove circular dependency from Koha::Object 2024-05-28 16:36:58 +00:00
EdiInvoice.t
…
EdiTransport.t
…
Edifact.t Bug 35398: Add unit test for extraction of library_rotation_plan 2024-03-19 15:21:43 +00:00
Ediorder.t Bug 31134: Mock EdifactLSQ for t/Edifact.t 2022-07-18 10:20:44 -03:00
Ediordrsp.t
…
Form_MessagingPreferences.t
…
HtmlTags.t
…
ImportBatch.t
…
Installer_PerlModules.t Bug 30731: Unit tests 2022-06-01 16:15:25 -03:00
ItemCirculationAlertPreference.t
…
Koha.t
…
Koha_MetadataRecord.t Bug 30358: Strip leading/trailing whitespace characters from input fields when cataloguing 2023-05-16 15:17:26 -03:00
Koha_SearchEngine_Elasticsearch_Browse.t
…
Koha_Template_Plugin_Cache.t
…
Koha_Template_Plugin_HtmlId.t
…
Koha_Template_Plugin_Koha.t Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed 2022-09-07 13:55:37 -07:00
Koha_Util_FrameworkPlugin.t
…
Koha_Util_MARC.t
…
Koha_XSLT_HTTPS.t Bug 12758: Introduce Koha::XSLT::HTTPS 2022-11-09 09:52:17 -03:00
Labels.t
…
Labels_split_Regex.t
…
Labels_split_ccn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_ddcn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_lccn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Languages.t
…
Logger.t Bug 32979: Skip test if running as root 2023-02-20 09:44:16 -03:00
Makefile.t Bug 31528: (QA follow-up) Exclude .stylelintrc.json in Makefile.t 2022-10-03 09:54:34 -03:00
Matcher.t Bug 28290: (follow-up) Unit test 2022-09-07 13:50:37 -07:00
Members_Messaging.t
…
OpenLibrarySearch.t
…
Output.t Bug 30524: Unit tests 2023-07-28 09:12:39 -10:00
Output_JSONStream.t
…
Patroncards.t
…
Patroncards_Batch.t
…
Patroncards_Lib.t
…
Patroncards_Patroncard.t
…
Patroncards_Profile.t
…
Patroncards_Template.t
…
RecordProcessor.t
…
Ris.t
…
SMS.t
…
Scheduler.t
…
Scrubber.t Bug 36328: (QA follow-up) Expand tests and reorder elements to clarify differences 2024-05-01 15:17:00 +00:00
Search.t Bug 34968: Remove unneeded module from Search.t 2023-10-05 10:08:18 -10:00
Search_PazPar2.t
…
SimpleMARC.t Bug 24480: (follow-up) Adjust tests 2023-11-09 15:58:08 -10:00
SocialData.t
…
Stats.t
…
SuggestionEngine.t
…
SuggestionEngine_AuthorityFile.t Bug 34970: Remove most modules from SuggestionEngine_AuthorityFile.t 2023-10-05 09:56:33 -10:00
TmplToken.t
…
Token.t Bug 34755: (Rmaint follow-up) Fix tests 2024-03-21 13:42:10 +00:00
dummy.t
…
template_filters.t
…
timezones.t
…