summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-02-08 16:49:25 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2012-02-08 16:49:25 +0100
commit578d62aea57e106bbb79e3c3e6a18aa58fbbe99f (patch)
treead2a4b88482882b34780040332523992480b7556 /template
parentb4a60112dc7f85d3afb94c099169986aa5056b06 (diff)
downloadbugzilla-578d62aea57e106bbb79e3c3e6a18aa58fbbe99f.tar.gz
bugzilla-578d62aea57e106bbb79e3c3e6a18aa58fbbe99f.tar.xz
Bug 722161: Clickjacking is possible in "View All" with HTML attachments
r=dkl a=LpSolit
Diffstat (limited to 'template')
-rw-r--r--template/en/default/attachment/show-multiple.html.tmpl20
1 files changed, 16 insertions, 4 deletions
diff --git a/template/en/default/attachment/show-multiple.html.tmpl b/template/en/default/attachment/show-multiple.html.tmpl
index 64b6ce767..8791e0dfe 100644
--- a/template/en/default/attachment/show-multiple.html.tmpl
+++ b/template/en/default/attachment/show-multiple.html.tmpl
@@ -75,10 +75,22 @@
</table>
[% IF a.is_viewable %]
- <iframe src="attachment.cgi?id=[% a.id %]" width="75%" height="350">
- <b>You cannot view the attachment on this page because your browser does not support IFRAMEs.
- <a href="attachment.cgi?id=[% a.id %]">View the attachment on a separate page</a>.</b>
- </iframe>
+ [% IF a.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
+ minrows = 10
+ cols = 80
+ defaultcontent = a.data
+ readonly = 'readonly'
+ classes = 'viewall_frame'
+ %]
+ [% ELSE %]
+ <iframe src="attachment.cgi?id=[% a.id %]" class="viewall_frame">
+ <b>You cannot view the attachment on this page because your browser does not support IFRAMEs.
+ <a href="attachment.cgi?id=[% a.id %]">View the attachment on a separate page</a>.</b>
+ </iframe>
+ [% END %]
[% ELSE %]
<p><b>
Attachment cannot be viewed because its MIME type is not text/*, image/*, or application/vnd.mozilla.*.