Block http content by CSP in extensions
Reported by
93m4qau...@gmail.com,
Mar 23 2018
|
||||||||
Issue descriptionVULNERABILITY DETAILS Chrome extension popups can load and run active mixed content (content from insecure origins like HTTP), such as iframes and scripts. In the attached testcase, the test extension loads an iframe to insecure http://www.example.com. This is a very dangerous situation as extensions run with higher privileges than normal webpages. Should the active mixed content be intercepted to contain malicious scripts, these scripts could be run with the privileges of the extension. This creates an extremely dangerous situation. Chrome blocks active mixed content that HTTPS-main-origin webpages attempt to load, but not active mixed content that extension popups attempt to load. VERSION Chrome Version: 67.0.3379.0 canary Operating System: Windows 7 Home Premium Service Pack 1 REPRODUCTION CASE 1. Download and extract the attached ZIP file containing the test extension. 2. Open chrome://extensions. 3. Enable developer mode. 4. Click "LOAD UNPACKED". 5. Select the folder containing the test extension. 6. Add the test extension to Chrome. 7. Click on the test extension's icon in the toolbar. Despite the fact that the iframe requests an insecure resource (http://www.example.com), it is loaded in the extension popup. This bug is subject to a 60-day disclosure deadline. If 60 days elapse without a fix in the source code, this bug will be publicly disclosed.
,
Mar 23 2018
Because extensions are subject to strict CSP requirements, I don't believe they can load an insecure remote script at all (see https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-remote-script). A quick test tweaking the test case extension verifies that this is the case. I've confirmed that the insecure iframe does load in the browser action popup (and can run javascript). I'm not sure what the security consequences of this are exactly -- I don't believe the iframe would have any special access, but it might expose the extension to a renderer exploit from a network attacker. Tentatively setting Severity-Low and impact on all OSes with extensions support.
,
Mar 23 2018
Re: Renderer exploit, extensions run their IFrames out-of-process for this reason. Similar discussions in Issue 451656.
,
Mar 24 2018
,
Mar 25 2018
It does indeed appear that the iframe to http://www.example.com is run out-of-process, meaning that there is a much lower risk after all of a modified resource being able to run at a higher privilege than a normal webpage. On the other hand, if active mixed content is going to be blocked on HTTPS-main-origin webpages, it really should be blocked in extension popups. I suspect that it isn't blocked in extension popups because HTTP is the main origin for the subframe that's running out-of-process, as active mixed content is only blocked (and, really, is only "mixed") on HTTPS-main-origin pages. Extension popups should also not be allowed to submit form fields to HTTP.
,
Mar 26 2018
Ah, I wasn't sure if OOPIF was the case here. Then I'm not sure if there's any remaining security risk (maybe at most a phishing risk via network attackers?). I would be generally fine with us aligning the default extension CSP to block this (e.g., `frame-src: https://*`?), but I think we'd want to do some measurement first. That change, however, feels more like a security feature rather than a bug fix. Do we have reason to think this would be abusable in a particular way? cc'ing some relevant folks to weigh in (meacer@ for extensions security, andypaicu@ for CSP and mkwst@ for mixed content).
,
Mar 26 2018
I've wanted to block mixed content in extension pages for a while, but the usage is an order of magnitude above where we've had successful deprecation/removal in the past: https://www.chromestatus.com/metrics/feature/timeline/popularity/662 (and since that's counting all pageviews, and not just extensions, the percentage of extension pageviews that would be affected is somewhat higher). I wouldn't be at all surprised if this boiled down to a handful of extensions with large numbers of users, but I haven't looked into any of it in detail. +Devlin, as this is certainly something to look at in v3, and if we could get rid of it in v2, I'd be even happier.
,
Mar 30 2018
This isn't a security bug, and is more-or-less working-as-intended. As mentioned, the http frame runs out-of-process from the extension, and does not have any elevated privileges. I agree with the sentiment here that it would be nice to be stricter about what extensions can include, and tighten the default CSP. I think that we can probably pursue that in manifest v3. Likely, it will not be worth the effort to try and deprecate it and migrate existing extensions over. I don't think there's any security risk here, or reason to keep this restricted. My proposal would be to rename this to be "Block http content by CSP in extensions" and unrestrict. Any objections?
,
Mar 30 2018
Re #8: making public SGTM.
,
Apr 6 2018
,
Apr 9 2018
Adding Security component and removing from the Security bug queue based on consensus around #8 (and updating title to match). |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by elawrence@chromium.org
, Mar 23 2018