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

Issue 699025 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Buried. Ping if important.
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: ----
Type: Bug-Security



Sign in to add a comment

Security: CSP override in dynamically created iframe from chrome extension

Reported by sepikas....@gmail.com, Mar 7 2017

Issue description

VULNERABILITY DETAILS
Page CSP is overridden from iframe which is dynamically created in chrome extension content script context. Dynamically created iframe has to have src attribute set to "#" (src="#");

VERSION
Chrome Version: 56.0.2924.87 (64-bit) stable
Operating System: macOS Sierra Version 10.12.3

REPRODUCTION CASE
Create simple chrome extension with single content script with following code:

if (window.top === window) {
    window.onload = function () {
        var img = document.createElement("img");
        img.setAttribute("src", "https://storage.googleapis.com/material-icons/external-assets/v4/icons/svg/ic_check_circle_black_24px.svg");
        var frame = document.createElement("iframe");
        frame.src = "#";
        frame.addEventListener("load", function () {
            var body = frame.contentWindow.document.querySelectorAll("body")[0];
            body.appendChild(img);
        });
        document.body.appendChild(frame);
    };
}

After extension has been loaded navigate to page which has Content-Security-Policy header. e.g. https://www.paypal.com/en/signup/account

You can see at the top left or at bottom left corners of the page that image was injected event though page Content-Security-Policy should prevent it.

 
Components: Blink>SecurityFeature
Owner: mkwst@chromium.org
Based on  Issue 391128 , my understanding is that Content-Security-Policy is deliberately bypassed by Content Scripts injected by extensions. Mike, can you confirm?

Comment 2 by mkwst@chromium.org, Mar 8 2017

Status: WontFix (was: Unconfirmed)
Right. Extensions can and should be empowered to bypass a page's policy: https://w3c.github.io/webappsec-csp/#extensions.

Thanks for the report! I'm closing this out as WontFix. If I've misunderstood the vulnerability you're reporting, please do add a comment accordingly. :)
Labels: -Restrict-View-SecurityTeam allpublic

Sign in to add a comment