LP1895660: EGCatLoader/Search.pm
authorJason Boyer <JBoyer@equinoxinitiative.org>
Tue, 15 Sep 2020 13:41:30 +0000 (09:41 -0400)
committerJason Boyer <JBoyer@equinoxinitiative.org>
Wed, 21 Oct 2020 16:42:57 +0000 (12:42 -0400)
commit191bde7fd202615650624d0aa038e6f40b1b5c2e
treee863a5abd21278abd626124275d379c7cba78482
parente3ce37b9b5df6e5ccfcb51878d706daa5e7f5207
LP1895660: EGCatLoader/Search.pm

CGI::param called in list context from ...
this can lead to vulnerabilities

For any call to $cgi->param that happens in a list context we need
to verify 2 things: 1, that it is intentional (otherwise use scalar())
and 2, that we don't use the results in an unsafe manner.
For those situations where it's safe and a list is expected (join,
foreach, etc.) there is a $cgi->multi_param() that behaves the same way
but does not issue a warning on use in a list context.

An assumption was made that there will only be a single 'query'
parameter (see _prepare_biblio_search_basics) but if that should
instead be run through a join() that function will need to be updated.

For more details about the potential issues read
https://metacpan.org/pod/distribution/CGI/lib/CGI.pod#Fetching-the-value-or-values-of-a-single-named-parameter

Note that this change will likely require additional testing to
be sure there are no surprises.

Signed-off-by: Jason Boyer <JBoyer@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm