Bug 34349: Validate/escape inputs for task scheduler
authorDavid Cook <dcook@prosentient.com.au>
Mon, 24 Jul 2023 04:31:15 +0000 (04:31 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 28 Sep 2023 16:06:05 +0000 (16:06 +0000)
commit61452e7d3dc92395de56ca56f585c6f26ae3a81a
treed02bbd3457fc7410613d8e176ace9178b4158759
parent621da0c1fd3e77e35158f6818a2f12239b01c165
Bug 34349: Validate/escape inputs for task scheduler

This change validates and escapes inputs for task scheduler.

Test plan:
0. Apply patch
1. koha-plack --reload kohadev
2. Go to http://localhost:8081/cgi-bin/koha/tools/scheduler.pl
3. Input a time a minute in the future and leave the date blank
4. Choose an existing report and output format
5. Type a malicious string which is also a valid email address
into the Email field
6. Click "Save"
7. Note that the job is added but the Email is wrapped in single
quotes
8. Try using a non-malicious email address with a single quote.
9. Note that the single quote is escaped, so that it will still
be used by runreport.pl

JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed pars for $email =~ regex, removed old commented lines.
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
tools/scheduler.pl