Bug 17022: Fix XSS in circ/branchtransfers.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 2 Aug 2016 13:00:02 +0000 (14:00 +0100)
committerChris Cormack <chris@bigballofwax.co.nz>
Mon, 8 Aug 2016 07:05:33 +0000 (19:05 +1200)
Test plan:
Enter the following in the barcode input:
    <script>alert('XSS')</script>

=> Without this patch you will see the alert
=> With this patch, no more alert

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit c63d0b311b5e7ba882d19b9b8a71838256de98cf)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 46322ffc6e683d0583283e7485548d46c9586019)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt

index 1d47060..ed6d8ae 100644 (file)
@@ -37,7 +37,7 @@
                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
                     [% IF ( waiting ) %]
-                        <input type="hidden" name="barcode" value="[% barcode %]" />
+                        <input type="hidden" name="barcode" value="[% barcode | html %]" />
                         <input type="hidden" name="request" value="KillWaiting" />
                         <input type="submit" value="Cancel" />
                     [% END %]
@@ -61,7 +61,7 @@
                             <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
                             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
                             <input type="hidden" name="tobranchcd" value="[% tobranchcd %]" />
-                            <input type="hidden" name="barcode" value="[% barcode %]" />
+                            <input type="hidden" name="barcode" value="[% barcode | html %]" />
                             <input type="hidden" name="request" value="KillReserved" />
                             <input type="submit" value="Cancel" />
                         </form>
                             <ul>
                              [% FOREACH errmsgloo IN errmsgloop %]
                               [% IF ( errmsgloo.errbadcode ) %]
-                                  <li>No Item with barcode: [% errmsgloo.msg %]</li>
+                                  <li>No Item with barcode: [% errmsgloo.msg | html %]</li>
                               [% END %]
                               [% IF ( errmsgloo.errispermanent ) %]
                                   <li>Please return item to home library: [% errmsgloo.msg %]</li>