Security: native functions like fetch can be overridden
Reported by
ethan.wa...@gmail.com,
Apr 25 2018
|
|||||
Issue description
VULNERABILITY DETAILS
The native function fetch can be overridden and used for malicious purposes. Even if a site is protected under SSL and their assets haven't been compromised, many sites use third-party components which fetch third-party assets that could be compromised and overload native functions that would then affect site assets that use those native functions that are executed after.
VERSION
Chrome Version: 66.0.3359.117 stable
Operating System: macOS High Sierra v10.3.3 (17D102)
REPRODUCTION CASE
<script>a = fetch; fetch = function(input, init){ alert('override'); return a(input, init);}; fetch('test')</script>
,
Apr 26 2018
,
Apr 27 2018
+Jake and Domenic in case they have opinions.
,
Apr 30 2018
Indeed, this is working as expected. Comment #1 points to the basic reasoning. For the concrete spec text that causes these properties to be writable/configurable, see https://heycam.github.io/webidl/#define-the-operations steps 3/4. The reproduction case involves someone running script on your page. However, if an attacker is able to run script on your page, you have already lost. Instead, ensure that attackers are not able to run JavaScript on your page. SSL/TLS is one of many technologies to help with this. It ensures that network attackers cannot modify your page to run their own JavaScript. But it is not the right technology for protecting against other attackers; for example, if you are writing a third-party component, you are always at the mercy of the person hosting you, and if they are the attacker, then you probably shouldn't be serving them script.
,
May 1 2018
Agreed. A third party script can do anything a first party script can do. Being able to overwrite `fetch` is pretty minor compared to other things it can do by design. You can use CSP and subresource integrity to control third party resources. I don't think this issue needs to be private.
,
Aug 7
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by elawrence@chromium.org
, Apr 25 2018Labels: OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac OS-Windows
Owner: kenjibaheux@chromium.org