Koha-clms/acqui
Martin Renvoize bbb7f406d2
Bug 30144: (QA follow-up) Fix stored XSS in servicing instructions
The RM's review found two stored XSS vectors in the servicing
instruction free-text (LVT) handling:

1. neworderempty.tt embedded the servicing instruction JSON (and the
   EDIFACT_SI authorised values list) directly into an inline <script>
   block via JSON.parse('[% ... | $raw %]'). TT's html filter does not
   escape single quotes, so a free-text value like
   test' + alert(1) + ' broke out of the JS string literal and
   executed on the next page load of the edit form.

2. basket.pl built the "Servicing instruction" column display by
   concatenating raw LVC/LVT values with '<br>' and rendering the
   result with | $raw in basket.tt, so HTML/script content in a
   free-text value executed directly on the basket page.

Fix the first by moving the JSON into existing/new hidden input
value="" attributes (escaped with the html filter, which is safe for
double-quoted HTML attributes) and reading them back via jQuery's
.val() before JSON.parse(), instead of interpolating untrusted data
into a JS string literal.

Fix the second by passing the display parts to the template as a list
and escaping each with the html filter at render time, instead of
building a pre-escaped raw HTML string in Perl.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-08-28 16:36:26 +00:00
..
acqui-home.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
addorder.pl Bug 30144: Add UI for servicing instructions 2026-08-28 16:36:22 +00:00
addorderiso2709.pl Bug 42764: Fix spelling errors across the codebase 2026-06-03 16:09:04 +00:00
ajax-getauthvaluedropbox.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
basket.pl Bug 30144: (QA follow-up) Fix stored XSS in servicing instructions 2026-08-28 16:36:26 +00:00
basketgroup.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
basketheader.pl Bug 41076: Adjust our perl tidiness for v20250105 2026-02-05 09:03:51 -07:00
booksellers.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
cancelorder.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
check_budget_total.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
check_uniqueness.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
duplicate_orders.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
edifactmsgs.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
edimsg.pl Bug 40383: Add JSON representation to Koha::Edifact and JSON download to edimsg.pl 2026-03-26 14:21:18 +01:00
finishreceive.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
histsearch.pl Bug 41454: Remove unused dbh calls 2026-04-15 09:14:51 -06:00
invoice-files.pl Bug 42080: (follow-up) limit data sent to libmagic to 100 characters 2026-06-26 11:56:58 +00:00
invoice.pl Bug 41996: Filter EDI errors on invoice page by invoicenumber 2026-08-18 11:21:34 +00:00
invoices.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
lateorders-export.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
lateorders.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
moddeliverydate.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
modordernotes.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
neworderempty.pl Bug 30144: (QA follow-up) Fix stored XSS in servicing instructions 2026-08-28 16:36:26 +00:00
newordersubscription.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
newordersuggestion.pl Bug 39726: Remove op connectDuplicate from acqui/newordersuggestions.pl 2026-06-19 15:39:10 +00:00
ordered.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
orderreceive.pl Bug 39724: Remove GetSuggestionInfo from C4/Suggestions.pm 2026-03-05 08:34:04 -07:00
parcel.pl Bug 39724: Remove GetSuggestionInfo from C4/Suggestions.pm 2026-03-05 08:34:04 -07:00
parcels.pl Bug 12278: Add a total column to the table in parcels.pl 2026-08-25 08:56:29 +00:00
showorder.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
spent.pl Bug 42225: (QA follow-up) Use configured unitprice field in outer SELECT 2026-07-16 10:54:38 +00:00
transferorder.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
uncertainprice.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
vendor_issues.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
vendors.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
z3950_search.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00