Field: opacnote
Created attachment 69104 [details] [review] Bug 19613 - Fix XSS in /cgi-bin/koha/circ/circulation.pl To Test 1. Hit the page /cgi-bin/koha/members/memberentry.pl 2. Add a text in the field opacnote that contains js 3. Save the page. 4. Notice js is execute 5. Apply patch and reload, the js is escaped
Created attachment 69109 [details] [review] Bug 19613 - Fix XSS in /cgi-bin/koha/circ/circulation.pl To Test 1. Hit the page /cgi-bin/koha/members/memberentry.pl 2. Add a text in the field opacnote that contains js 3. Save the page. 4. Notice js is execute 5. Apply patch and reload, the js is escaped Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Awaiting QA!
I think this change could be controversial as it will also disallow to use HTML in the note. Some libraries could see this as an unwanted change of behaviour. Could we create a filter that is more smart and only kills JavaScript?
Created attachment 163194 [details] [review] Bug 19613: Scrub borrowers fields: borrowernotes opacnote To prevent XSS
Created attachment 163498 [details] [review] Bug 19613: Use the 'note' profile
Maybe instead, notes need a wysiwyg editor that only allows the most benign types of html
Should the template be modified in this patch to use the $raw filter when showing opacnote? We do that for borrowernotes on moremember.pl.
I'm not sure about this one. It'll scrub new notes added, but if you already have bad notes they won't be scrubbed when you re-save the patron record. It also doesn't stop bad notes from being displayed. But I think it's a start, so I think I'll Sign Off.
Created attachment 163585 [details] [review] Bug 19613: Scrub borrowers fields: borrowernotes opacnote To prevent XSS Signed-off-by: David Cook <dcook@prosentient.com.au>
Created attachment 163586 [details] [review] Bug 19613: Use the 'note' profile Signed-off-by: David Cook <dcook@prosentient.com.au>
Created attachment 164211 [details] [review] Bug 19613: Scrub borrowers fields: borrowernotes opacnote To prevent XSS Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 164212 [details] [review] Bug 19613: Use the 'note' profile WNC amended patch: tidied Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This doesn't apply cleanly to 22.05.x - could it please be rebased for the branch?
Applied to 22.11. Backporting 'note' C4::Scrubber profile. May be necessary for 22.05.
Pushed for 24.05! Well done everyone, thank you!
(In reply to wainuiwitikapark from comment #14) > This doesn't apply cleanly to 22.05.x - could it please be rebased for the > branch? I see it in in 22.05.x