r/javascript • • Aug 11 '17

Reverse engineering PopUnder trick for Chrome 60

https://www.youtube.com/watch?v=PPzRcZLNCPY
382 Upvotes

19 comments sorted by

17

u/[deleted] Aug 11 '17

Very informative.

So for Google to fix this, could they not just require that any mouseup event for a given window require a corresponding mousedown?

17

u/LiveOverflow Aug 11 '17

That was basically also the issue:

On the Mac, the mouseup from a mousedown only gets delivered to the page that got the mousedown. On Windows (but interestingly, not MacViews!) the mouseup can get delivered to a different page than the mousedown.

But the fix was a bit more powerful.

Expand the power of the popunder preventer.

If any WebContents in the opener chain of a popup attempts to bring itself forward in front of the popup, block that attempt to create a popunder.

https://bugs.chromium.org/p/chromium/issues/detail?id=752824

20

u/wavefunctionp Aug 11 '17

So much wasted talents on popups of all things....

22

u/LiveOverflow Aug 12 '17

there is money in ads ;)

8

u/monsto Aug 12 '17

I've been struggling with JS...

This vid, thru your highly explanatory approach, showed me that I'm not struggling with the language itself, but with my own assessment of how much I thought I knew.

I was able to follow everything you said. I mean, like being a fan of a sport, I can understand the finer points of what's going on without necessarily being able to do it myself.

Great video.

6

u/Dark_Prism Aug 12 '17

I love this. I want this to be a continuing series where you battle against the shady pop-under developer. He continues to discover new and interesting ways to circumvent the blockers while you continue to discover new and interesting ways to debug and deconstruct his code. Eventually he will run out of options and be defeated, thereby being forced to reveal himself.

But there's a twist!

.

.

.

.

.

.

It was Avi Drissman the whole time!

3

u/dartmanx Aug 12 '17

And he would have gotten away with it too! If it weren't for you kids and that mangy mutt!

2

u/GBcrazy Aug 12 '17

That's great!

1

u/tsirolnik Aug 12 '17

Really cool, thanks for sharing

1

u/Daniel15 React FTW Aug 12 '17 edited Aug 12 '17

This is a great video! Thank you so much for posting it :D

Since it's using a mouseup handler, does that mean that the new tab would be more obvious if you just hold down the mouse button without releasing it?

1

u/keystorm Aug 12 '17

Yep, I think it would.

1

u/SpineEyE Aug 12 '17

So the performance profiler includes the content of popups, nice to know.

1

u/Bamboo_the_plant Aug 12 '17

This is debugging on another level. Very eye-opening. Link to the author's subreddit here: /r/LiveOverflow

1

u/inajeep Aug 12 '17

Great pace and informative, keep going.

0

u/[deleted] Aug 11 '17

[deleted]

12

u/LiveOverflow Aug 11 '17

thanks for checking it out despite the points :)

I was hoping that /r/javascript has some more advanced tips and tricks for me.

2

u/joshTheGoods Full Stack JavaScript Aug 14 '17

Few quick tips... Check out Ahamed Nafeez's talk here. He talks about generic vulnerabilities (namely typical XSS stuff), but he hits on a few points that are useful to you around monitoring native methods. He also released a library that might be useful to you: Hookish.

Lastly, I wrote a security application using DOM proxies years ago and ended up having a team rewrite it all using MutationObservers. Might be a better API than manually proxying native methods.

1

u/LiveOverflow Aug 15 '17

thanks! But I checked it out and it breaks the demo site:

Uncaught TypeError: zBCa.l is not a function

Ah yeah, MutationObservers could be really cool for the iframe/object/... parts

44

u/nplus Aug 11 '17

Probably downvoted by the pop-under developer ;)