News for hackers. Stuff that matters.

Ask HN: Facebook clickjacking – is it detectable?

I went to scammy clickbait website the other day and afterwards noticed that I "liked" them on Facebook.

After doing some research I released that I had been clickjacked, which is when a website hides a certain button underneath another button so that when I click one thing, for example a play now button, I'm actually also clicking another button, like a Facebok like.

My question is: can Facebook and/or Google punish sites for things like this?

Aside from it being sleezy, why doesn't other sites do this?

( 22 comments | 18 points | on HN )
Re:Ask HN: Facebook clickjacking – is it detectable? by socket0 on Monday September 14, 2015 @07:57AM (#10214652)
It's possible to detect whether an element is visible using window.getComputedStyle(). Why don't Facebook do this? Because it's slow. And measures like this can cause problems on the page. They want their button integration to be fast and low impact, so they would rather handle a couple of abusers (which they're quite good at) than inconvenience a large number of sites.
Re:Ask HN: Facebook clickjacking – is it detectable? by mattmanser on Monday September 14, 2015 @09:18AM (#10214882)
'Because it's slow' doesn't seem to make much sense to me. Couldn't they register the click then do the check, allowing them to have the best of both worlds?
Re:Ask HN: Facebook clickjacking – is it detectable? by socket0 on Monday September 14, 2015 @10:08AM (#10215106)
It's JavaScript, so the client pays for it. If you're on an already slow browsers, you don't want to see it choke after you click on a button. So companies like Facebook ignore the problem on the client side, and solve it on the server side.
Re:Ask HN: Facebook clickjacking – is it detectable? by MasterScrat on Monday September 14, 2015 @09:08AM (#10214843)
Couldn't an attacker override window.getComputedStyle() at runtime anyway?
Re:Ask HN: Facebook clickjacking – is it detectable? by socket0 on Monday September 14, 2015 @10:15AM (#10215140)
Presumably Facebook would have CSP headers set on some of the scripts they load to prevent JavaScript on the page from interacting with their own scripts.
Re:Ask HN: Facebook clickjacking – is it detectable? by malft on Tuesday September 15, 2015 @09:05AM (#10220382)
getComputedStyle() doesn't work across iframes.
Re:Ask HN: Facebook clickjacking – is it detectable? by jbombadil on Monday September 14, 2015 @07:44AM (#10214612)
The simplest way to avoid this (though it does require some guesswork on your part) is to always open those suspicious sites with incognito mode. If when you click the button it asks you to log into facebook (don't) you would have been clickjacked.
Re:Ask HN: Facebook clickjacking – is it detectable? by madawan on Monday September 14, 2015 @09:12AM (#10214859)
A simpler way is to have a seperate Chrome (or Firefox) profile for Facebook. I have an icon in my taskbar for Gmail and it simply opens up Chrome with that profile, which has Gmail set as homepage.

Not a perfect solution, but good first line of defense none-the-less.

Re:Ask HN: Facebook clickjacking – is it detectable? by kevinsimper on Monday September 14, 2015 @07:14AM (#10214539)
Facebook will after a certain point put a captcha if they suspect clickjacking, and they do that incredible fast!

It is properbly a combination of user tracking and how many removes the like just after the see it on their own profile.

Re:Ask HN: Facebook clickjacking – is it detectable? by picibucor on Monday September 14, 2015 @09:22AM (#10214900)
It won't happen if you aren't always logged in Facebook. Log out from Facebook after you used it...
Re:Ask HN: Facebook clickjacking – is it detectable? by 7Z7 on Monday September 14, 2015 @09:55AM (#10215050)
>after you used it

You clearly have a different Facebook use-case than a lot of people.

Re:Ask HN: Facebook clickjacking – is it detectable? by picibucor on Friday September 18, 2015 @08:19AM (#10238710)
I'm special... ;)
Re:Ask HN: Facebook clickjacking – is it detectable? by itsbits on Monday September 14, 2015 @07:05AM (#10214515)
Can you give me an example site which has that. May be we can build a chrome app/extension for that.
Re:Ask HN: Facebook clickjacking – is it detectable? by monochromatic on Monday September 14, 2015 @09:11AM (#10214855)
Related question: is there a place in my Facebook profile where I can see everything I've liked?
Re:Ask HN: Facebook clickjacking – is it detectable? by smackfu on Monday September 14, 2015 @09:34AM (#10214944)
Also, this shows all activity, in chronological order:

https://www.facebook.com/me/allactivity

Re:Ask HN: Facebook clickjacking – is it detectable? by JackuB on Monday September 14, 2015 @09:13AM (#10214864)
Re:Ask HN: Facebook clickjacking – is it detectable? by Eridrus on Monday September 14, 2015 @12:54PM (#10216032)
This talk describes what Facebook does to combat clickjacking: https://www.youtube.com/watch?v=0ih8TSXi3e4#t=12m29s

It's an interesting watch, and they probably stop a few people, but the description they give sounds very bypassable by seeding the links with a certain amount of "legit" clicks.

They pretty much punish websites that use clickjacking by forcing their users to validate the click with popups.

Re:Ask HN: Facebook clickjacking – is it detectable? by timewarp256 on Monday September 14, 2015 @12:04PM (#10215733)
According to this http://stackoverflow.com/q/7328295/413180 there's no known way to prevent both Clickjacking and CSRF at the same time in a widget - unless you have an ugly popup asking the user to confirm the like.
Re:Ask HN: Facebook clickjacking – is it detectable? by z3t4 on Monday September 14, 2015 @07:04AM (#10214511)
Depending on the algorithm for "homepage news" on say Facebook. Having fake "likes" will result in your "news" being seen only by "fake" people or people that are not interested.
Re:Ask HN: Facebook clickjacking – is it detectable? by dacohenii on Tuesday September 15, 2015 @09:24AM (#10220447)
I once heard of an instance where the link redirected to a legit website for requests coming from Facebook's IP, and to a scam-type website from all other IPs.
Re:Ask HN: Facebook clickjacking – is it detectable? by cosmeen on Monday September 14, 2015 @08:03AM (#10214672)
opece.eu

This is an example of likejacking website. The text is in romanian and it's says it's donating an apartment via a contest if you fill that form.

The "Trimite" (Send) button is where the like jacking occurs.

Re:Ask HN: Facebook clickjacking – is it detectable? by ljk on Monday September 14, 2015 @04:15PM (#10217206)
installing extensions like NoScript, Privacy Badger, Ghostery might prevent the links from sneaking up