New issue
Advanced search Search tips

Issue 865364 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Bug in asynchronous calls that allows calling javascript after a window.open call

Reported by neutrino...@gmail.com, Jul 19

Issue description

This template is ONLY for reporting security bugs. If you are reporting a
Download Protection Bypass bug, please use the "Security - Download
Protection" template. For all other reports, please use a different
template.

Please see the following link for instructions on filing security bugs:
https://www.chromium.org/Home/chromium-security/reporting-security-bugs

NOTE: Security bugs are normally made public once a fix has been widely
deployed.

VULNERABILITY DETAILS
This vulnerability allows a javascript call to be made after window.open is called

VERSION
Chrome Version: Google Chrome 66.0.3359.117 stable
Operating System: Kali linux, 2018.1, 4.14.0-kali3-amd64

REPRODUCTION CASE
Unpack the attached zip file and load index.html, most preferably from a local server due to a "window.location.pathname" being set (NOTE: I am using 16GB of ram and Computing power is important in this vulnerability)

And i would also like to add that in the hands of an attacker that can corrupt memory, javascript can be placed in the redirected website.

Also this attack has an 80% success rate on my laptop. 
Sometimes the intended website is loaded but most times the page is redirected

This is my first ever bug report and i would appreciate it if you treat me as the novice that i am and give me the opportunity to explain more about this.

Thanks for the attention!!!.

 
Chrome_BUG.zip
2.3 KB Download
Labels: Needs-Feedback
Thanks for the report!

I'm having some trouble reproducing this locally. Could you give some more detail about what the expected behavior is and how the attack works? Also, do you think this would work (or could be made to work) when the target page in the attack is on a different origin?

Here's what I tried using Chrome 69 on Linux:

1. Start local server using `python -m SimpleHTTPServer`
2. Navigate to http://localhost:8000/index.html
3. See a lot of "Hey<random characters>" output
4. See a javascript alert that says "Leaving"; click "OK"
5. Automatically navigated to http://localhost:8000/another.html where it just says "Wait a minute... You are not supposed to be here."

I also tried in Chrome 66.0.3359.117 ASAN build (to try to match the version you tested on) but had the same result.
I replied via email but I am not sure if that was the right channel for that so this is a follow up.

In line 33 of index.html there is a call to window.open to redirect to site2.html if a certain value is set to true which it will be set to after 4000ms

The expected behavior is for the browser to open site two but asynchronous calls made during that time override this behavior and redirects you to another.html with the text "Wait a minute... You are not supposed to be here". The redirection to another.html only occurs after the window.open is called and so redirecting to my specified page is definitely not wanted in this case
Project Member

Comment 3 by sheriffbot@chromium.org, Jul 19

Cc: cthomp@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: -cthomp@chromium.org
Components: Blink>JavaScript
Labels: -Type-Bug-Security -Restrict-View-SecurityTeam OS-Linux Type-Bug
Status: Untriaged (was: Unconfirmed)
Summary: Bug in asynchronous calls that allows calling javascript after a window.open call (was: Security: Bug in asynchronous calls that allows calling javascript after a window.open call)
Thanks for the additional details. I've been able to reproduce the behavior you described on Chrome 69 on Linux (where the navigations occur in that order).

This falls under one of the exceptions to the same-origin policy when you have a handle to the Window object (https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#Window) -- read/write access to window.location is allowed.

Typically this behavior would be for popups, but there may be a brief time when the prior javascript execution context can finish executing deferred tasks after another navigation is committing. I don't think there are any security consequences here, since you could explicitly do the same thing without the timing race by opening site2.html in a popup, and that would fully fall under the exception allowed under the same-origin policy. (Additionally, with site-isolation, cross-site navigations like this are forced into separate processes, so even if the old javascript execution context is still running it can't use this trick to load a different site into its process.)

This is, however, a potentially confusing behavior that could occur with kinda-buggy asynchronous javascript navigations on sites in the wild, so I'll leave this as a functional bug that the V8 team can consider.

If you come up with other tricks you can pull off, please file a new security bug and one of us would be happy to take a look :-)
The review process made it a nice first bug reporting experience for me. Thank you for making it pleasant for a tech enthusiast still months shy of 18. I am hopeful that I have been able to at least add value to the project as I look forward to helping out whenever possible, to make technology better in the service of humanity.

Sorry about going philosophical, Sometimes i just get in the mood :)
Good morning, sorry to disturb but i changed the url in the open call to "http://www.google.com" and i still got the same results, hoping you could confirm this at your end
index.html
4.5 KB View Download
Yep, I would expect that this can still work even when the window opened is to a different origin. Read/write access to window.location is allowed as an exception to the same-origin policy if you have access to the window object.

Happy bug hunting :-)
Components: -Blink>JavaScript Blink>JavaScript>API
Labels: Pri-3
Status: Available (was: Untriaged)

Sign in to add a comment