Closed Bug 1235772 Opened 10 years ago Closed 10 years ago

Display all text/* attachments as plain text in the "Details" page

Categories

(Bugzilla :: Attachments & Requests, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 6.0

People

(Reporter: LpSolit, Assigned: LpSolit)

Details

Attachments

(1 file)

There are still many users reporting bugs that you can do XSS with attachments if you use MIME types such as text/xml or SVG. Just see all the duplicates in bug 38862. One of the reasons is that BMO is way behind (still runs 4.2) and so didn't move to HTML5 capabilities available in Bugzilla 5.0 yet. With HTML5, you can use the 'sandbox' attribute on <iframe> which blocks all scripts and form submissions. This means that it's no longer possible to trigger popups from the Details page (since Bugzilla 5.0!). But this also means that it makes less sense to still try to render the generated XML or SVG page, because scripts are disabled. So my proposal is to always display the source code of attachments whose MIME type is text/* instead of doing it for text/html only. Of course, we must keep <iframe sandbox> in the code in case someone tries to fool the web browser by typing another MIME type, e.g. image/*, and expect the web browser to sniff its content to render it as a HTML/XML/SVG/... page. This bug is independent of bug 549182.
Assignee: attach-and-request → LpSolit
Summary: Display all text/* attachment as plain text in the "Details" page → Display all text/* attachments as plain text in the "Details" page
Target Milestone: --- → Bugzilla 6.0
Attached patch patch, v1Splinter Review
Attachment #8702922 - Flags: review?(gerv)
Comment on attachment 8702922 [details] [diff] [review] patch, v1 Review of attachment 8702922 [details] [diff] [review]: ----------------------------------------------------------------- r=gerv. Gerv
Attachment #8702922 - Flags: review?(gerv) → review+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 160a960..76d1a3d master -> master
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: