New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 595476 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

MHTML broken when Content-Security-Policy declared via <meta> element

Project Member Reported by lukasza@chromium.org, Mar 16 2016

Issue description

Repro:

1. Launch Chrome with MHTML enabled in Save-Page-As UI by using --save-page-as-mhtml flag (normally it is only enabled on ChromeOS + via extensions + via Offline Pages feature).

2. Open a page that declares CSP directives via <meta> element and embeds one or more child frames from an origin whitelisted via child-src:

  <meta http-equiv="Content-Security-Policy"
        content="img-src 'self'; child-src 'self'">

3. Save the page from previous step as MHTML

4. Open MHTML in Chrome

Expected behavior: MHTML renders in the same way as the original page

Actual behavior: MHTML cannot open child frames:

Refused to frame 'cid:frame-2-A869839A-6287-4C4B-ADDF-AB62C4AF9FBF@mhtml.blink' because it violates the following Content Security Policy directive: "child-src 'self'

(MHTML uses 'cid:' scheme to link to other MHTML parts - see https://tools.ietf.org/html/rfc2557#section-8.3).
 
Cc: mkwst@chromium.org est...@chromium.org
+estark@ and mkwst@ for CSP aspect of this
Cc: alex...@chromium.org
+alexmos@

Comment 3 by dim...@chromium.org, Mar 16 2016

Components: UI>Browser>Offline

Comment 4 Deleted

Owner: dim...@chromium.org

Comment 6 by dim...@chromium.org, Sep 27 2016

Need to remove the meta tag - potentially part of the MHTML sanitizer project.

Comment 7 by mkwst@google.com, Sep 29 2016

Same comment as the other bug: removing `<meta>` is a fine workaround as long as MHTML remains inert. If/when it grows an origin and executes script, removing the page's policy is dangerous.

Comment 8 by dim...@chromium.org, Jan 26 2017

Owner: jianli@chromium.org
Part of MHTML sanitization.

Comment 9 by jianli@chromium.org, Feb 22 2017

Status: Started (was: Assigned)
Comment #7: MHTML as we know it will have to be inert forever... To be used as a 'printout' of a page. If it grows origin trust it'll likely be a different standard.
Status: Fixed (was: Started)

Sign in to add a comment