From: Dan Scott Date: Wed, 17 Aug 2011 19:36:15 +0000 (-0400) Subject: Escape TPAC "myopac" output to protect against XSS attacks X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=72a2d5b8855d5d22ca6865a539a4552404cd32a6;p=contrib%2FConifer.git Escape TPAC "myopac" output to protect against XSS attacks We're using the Template::Toolkit html and uri filters to ensure that the usual suspects are escaped at output time to prevent trivial XSS attacks. Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/templates/default/opac/myopac/circ_history.tt2 b/Open-ILS/src/templates/default/opac/myopac/circ_history.tt2 index 9d88fe8932..d7c7989220 100644 --- a/Open-ILS/src/templates/default/opac/myopac/circ_history.tt2 +++ b/Open-ILS/src/templates/default/opac/myopac/circ_history.tt2 @@ -71,9 +71,9 @@ [% attrs.title %] + name="[% l('Catalog record') %]">[% attrs.title | html %] [% IF attrs.author %] / - [% attrs.author %] + [% attrs.author | html %] [% END %] @@ -90,8 +90,8 @@ * [% END; %] - [% circ.circ.target_copy.barcode %] - [% circ.circ.target_copy.call_number.label %] + [% circ.circ.target_copy.barcode | html %] + [% circ.circ.target_copy.call_number.label | html %] [% END %] diff --git a/Open-ILS/src/templates/default/opac/myopac/circs.tt2 b/Open-ILS/src/templates/default/opac/myopac/circs.tt2 index 2275aff036..c87852458c 100644 --- a/Open-ILS/src/templates/default/opac/myopac/circs.tt2 +++ b/Open-ILS/src/templates/default/opac/myopac/circs.tt2 @@ -106,9 +106,9 @@ - [% attrs.title %] + [% attrs.title | html %] [% IF attrs.author %] / - [% attrs.author %] + [% attrs.author | html %] [% END %] @@ -119,18 +119,18 @@ [% date.format(ctx.parse_datetime(circ.circ.due_date),DATE_FORMAT) %] - [% circ.circ.target_copy.barcode %] + [% circ.circ.target_copy.barcode | html %] - [% circ.circ.target_copy.call_number.label %] + [% circ.circ.target_copy.call_number.label | html %] [% IF circ.renewal_response AND circ.renewal_response.textcode != 'SUCCESS' %] [%# XXX colspan="0" does not work in IE %] - - [% circ.renewal_response.desc || circ.renewal_response.payload.fail_part || circ.renewal_response.textcode %] + + [% (circ.renewal_response.desc || circ.renewal_response.payload.fail_part || circ.renewal_response.textcode) | html %] diff --git a/Open-ILS/src/templates/default/opac/myopac/hold_history.tt2 b/Open-ILS/src/templates/default/opac/myopac/hold_history.tt2 index d3453d786b..ca0ac59491 100644 --- a/Open-ILS/src/templates/default/opac/myopac/hold_history.tt2 +++ b/Open-ILS/src/templates/default/opac/myopac/hold_history.tt2 @@ -81,7 +81,7 @@ - [% ctx.get_aou(ahr.pickup_lib).name %] + [% ctx.get_aou(ahr.pickup_lib).name | html %] [% IF ahr.frozen == 't' AND ahr.thaw_date; diff --git a/Open-ILS/src/templates/default/opac/myopac/holds.tt2 b/Open-ILS/src/templates/default/opac/myopac/holds.tt2 index 442a1dfbc8..a835223344 100644 --- a/Open-ILS/src/templates/default/opac/myopac/holds.tt2 +++ b/Open-ILS/src/templates/default/opac/myopac/holds.tt2 @@ -154,7 +154,7 @@ - [% ctx.get_aou(ahr.pickup_lib).name %] + [% ctx.get_aou(ahr.pickup_lib).name | html %] - [% | l(ctx.invalid_username) %] - "[_1]" is not a valid username. Usernames cannot have any spaces. Please try a different username. - [% END %] + [% l('"[_1]" is not a valid username. Usernames cannot have any spaces. Please try a different username.', ctx.invalid_username) | html %] [% ELSIF ctx.username_exists %]
- [% | l(ctx.username_exists) %] + [% bad_user = ctx.username_exists | html %] + [% | l(bad_user) %] The username "[_1]" is taken. Please try a different username. [% END %]