codebrowse displays HTML content unmunged

Bug #115174 reported by James Henstridge
256
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Michael Hudson-Doyle
loggerhead
Fix Released
Critical
Robey Pointer

Bug Description

If a branch contains an HTML file, codebrowse can display it by clicking the "download" link. For example:

http://codebrowse.launchpad.net/~vcs-imports/viewvc/trunk/download/vcs-imports%40canonical.com-20070410161038-e2cb3080291d69cd/license.html-20070414165915-x3418xbm42yqb98z-1/LICENSE.html

If the HTML page contains javascript (or loads javascript from offsite with <script src="...">), then it will be executed from the http://codebrowse.launchpad.net principal.

Since we are only serving codebrowse via http and not https, it doesn't expose Launchpad session cookies. However, if we want to serve codebrowse over https and do authentication (e.g. to support browsing of private branches), we will need to remove or neutralise this feature.

Possible ways to neutralise the problem:
 * serve all content with an innocuous mime type (e.g. application/octet-stream).
 * send a header like "Content-Disposition: attachment" to tell the browser to show a "save as" dialog rather than displaying the page (would need testing).

David Allouche (ddaa)
Changed in launchpad-bazaar:
assignee: nobody → mwhudson
importance: Undecided → Critical
status: Unconfirmed → Confirmed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

The fix (to use Content-Disposition: attachment in download links) is online now.

Changed in launchpad-bazaar:
status: Confirmed → Fix Released
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Robey, here's the patch that we're using on codebrowse. If you make me a member of the loggerhead team and transfer the ownership of the 'devel' branch here, I can push the changes to it...

Revision history for this message
Robey Pointer (robey) wrote :

i think i picked this up when merging from your test branch yesterday. yikes! i hadn't thought about the javascript aspect before.

Changed in loggerhead:
assignee: nobody → robey
importance: Undecided → Critical
status: New → Fix Committed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Released in 1.2.

Changed in loggerhead:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
visibility: private → public
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.