Koha-clms/opac
Michał Górny dbe7d8f601 Bug 34023: Prevent HTML injection in "back to results" link from search page
It is possible inject raw HTML into the "Back to search results" link by leading the user to a search with specially crafted URL.

For example, using the demo instance:

1. Visit https://koha.adminkuhn.ch/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1&%22%3Etest%3Ca%20foo=%22

2. Refresh the page (for some reason, "back to results" doesn't appear unless I do that at least once).

3. Click any result.

Note that the result page now contains:

  <a href="opac-search.pl?idx=&amp;q=test&amp;weight_search=1&amp;">test<a foo=%22" title="...

i.e. `">test<a ...` was successfully injected into the HTML.

I'm attaching a quick patch I've used to patch up our instance.  It just indiscriminately URI-escapes all parameter keys.  I didn't decode them back since as far as I understand all valid keys do not contain special characters.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e86e81a2480ec5486660bac241c694210eaefa11)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-07-28 09:12:39 -10:00
..
clubs
…
errors
…
external/overdrive
…
sci
…
sco
…
svc Bug 33697: Remove RecordedBooks (rbdigital) integration 2023-06-09 11:22:15 -03:00
ilsdi.pl
…
maintenance.pl
…
oai.pl
…
opac-ISBDdetail.pl
…
opac-MARCdetail.pl
…
opac-account-pay-return.pl
…
opac-account-pay.pl
…
opac-account.pl
…
opac-addbybiblionumber.pl
…
opac-alert-subscribe.pl
…
opac-article-request-cancel.pl
…
opac-authorities-home.pl Bug 33803: Remove comment about tab width 2023-06-09 11:22:17 -03:00
opac-authoritiesdetail.pl Bug 21330: Allow XSLT for authority detail view in OPAC 2023-05-15 18:24:03 -03:00
opac-basket.pl
…
opac-blocked.pl
…
opac-browse.pl
…
opac-browser.pl
…
opac-changelanguage.pl
…
opac-course-details.pl
…
opac-course-reserves.pl
…
opac-curbside-pickups.pl
…
opac-detail.pl Bug 34218: Send a record copy to avoid loss of information and display problems 2023-07-18 10:33:14 +01:00
opac-discharge.pl
…
opac-dismiss-message.pl
…
opac-downloadcart.pl
…
opac-downloadshelf.pl
…
opac-export.pl
…
opac-holdshistory.pl
…
opac-ics.pl
…
opac-idref.pl
…
opac-illrequests.pl Bug 33702: (QA follow-up) Do not crash on borrowernumber 2023-05-29 09:21:51 -03:00
opac-image.pl Bug 33047: Return 404 instead of 500 when biblio does not exist 2023-07-18 10:28:24 +01:00
opac-imageviewer.pl
…
opac-issue-note.pl
…
opac-library.pl
…
opac-main.pl
…
opac-memberentry.pl
…
opac-messaging.pl
…
opac-modrequest-suspend.pl
…
opac-modrequest.pl
…
opac-mymessages.pl
…
opac-news-rss.pl
…
opac-overdrive-search.pl
…
opac-page.pl
…
opac-passwd.pl
…
opac-password-recovery.pl
…
opac-patron-consent.pl
…
opac-patron-image.pl
…
opac-privacy.pl
…
opac-ratings.pl
…
opac-readingrecord.pl Bug 33951: (QA follow-up) Import GetNormalizedOCLCNumber 2023-07-12 07:58:01 +01:00
opac-recall.pl
…
opac-recalls.pl
…
opac-registration-verify.pl
…
opac-renew.pl
…
opac-reportproblem.pl
…
opac-request-article.pl
…
opac-reserve.pl Bug 34178: Cache ItemsAnyAvailableAndNotRestricted in memory and don't precalculate 2023-07-25 10:20:51 -10:00
opac-reset-password.pl
…
opac-restrictedpage.pl
…
opac-retrieve-file.pl
…
opac-review.pl
…
opac-routing-lists.pl
…
opac-search-history.pl
…
opac-search.pl Bug 34023: Prevent HTML injection in "back to results" link from search page 2023-07-28 09:12:39 -10:00
opac-sendbasket.pl Bug 33223: Replace 'first_valid' with 'notice' for email addresses 2023-05-16 15:17:35 -03:00
opac-sendshelf.pl Bug 33223: Fix sendshelf 2023-05-16 15:17:36 -03:00
opac-serial-issues.pl
…
opac-shareshelf.pl
…
opac-shelves.pl
…
opac-showmarc.pl
…
opac-showreviews.pl
…
opac-suggestions.pl Bug 33236: Move NewSuggestion to Koha::Suggestion->store 2023-06-09 12:04:46 -03:00
opac-tags.pl
…
opac-tags_subject.pl
…
opac-topissues.pl
…
opac-user.pl Bug 33957: Add normalized_oclc and only fetch when needed 2023-07-12 09:18:21 +01:00
tracklinks.pl
…
unapi
…