From: Frédéric Buclin Date: Tue, 10 Jan 2012 00:03:49 +0000 (+0100) Subject: Bug 716283: Clickjacking in the attachment "Details" page allows to bypass token... X-Git-Tag: bugzilla-4.0.4~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b466bd6a32575f55586336f72d8ccfce0fa1f2d;p=thirdparty%2Fbugzilla.git Bug 716283: Clickjacking in the attachment "Details" page allows to bypass token checks r=dkl a=LpSolit --- diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index c0d30610ae..876d47e55e 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -205,10 +205,22 @@ defaultcontent = (attachment.contenttype.match('^text\/')) ? attachment.data.replace('(.*\n|.+)', '>$1') : undef %] - + [% IF attachment.contenttype == "text/html" %] + [%# For security reasons (clickjacking, embedded scripts), we never + # render HTML pages from here. The source code is displayed instead. %] + [% INCLUDE global/textarea.html.tmpl + id = 'viewFrame' + minrows = 10 + cols = 80 + defaultcontent = attachment.data + readonly = 'readonly' + %] + [% ELSE %] + + [% END %]