How YouPorn Tries To Hide That It's Spying On Your Browsing History

from the what,-no-rot-13? dept

There’s a fair bit of attention being paid to a Forbes article about some new research concerning how a bunch of websites, including YouPorn, are exploiting a simple security hole to see what other sites you’ve visited:

How does it work? It’s based on your browser changing the color of links you’ve already clicked on. A script on the site exploits a Web privacy leak to quickly check and see whether your browser reveals that the links to a host of other porn sites have been assigned the color “purple,” meaning you’ve clicked them before.

This isn’t a huge surprise, but what I found most fascinating was how YouPorn sought to hide this bit of javascript by “encrypting” it. And by “encrypting” it, I mean switching letters one letter up in the alphabet. As Kashmir Hill explains:

The script on YouPorn?s site that checks a user?s history (which you can see for yourself by going to the site and checking out its html with ?View Source?) looks like this:

<script type="text/javascript">
function ypol(){var k={0:"qpsoivc/dpn",1:"sfeuvcf/dpn",
var g=[];for(var m in k){var d=k[m];
var a="";for(var f=0;f<d.length;f++)
{a+=String.fromCharCode(d.charCodeAt(f)-1)}var h=false;
for(var j in {"http://":"","http://www.":""})
{var l=document.createElement("a");
var e="";if(navigator.appName.indexOf("Microsoft")!=-1){e=l.currentStyle.color}
if(e=="rgb(12, 34, 56)"||e=="rgb(12,34,56)"){h=true}}if(h){g.push(m)}}
var b=(g instanceof Array)?g.join(","):"";var c=document.createElement("img");

That list of gibberish contains the sites that YouPorn is checking to see if you?ve visited, but disguises them with a bit o? simple cryptography. Dial back each letter by one, so ?qpsoivc/dpn?, for example, becomes ?

What’s amazing is that anyone actually thought this was a worthwhile move. It’s not that hard to “decrypt” and it’s almost obvious to the naked eye because it’s not too difficult to figure out how the “encryption” (and I use that word loosely) works just by noticing all the terms that end in /dpn. You’d think even a rot-13 would throw a few more people off the scent.

Filed Under: , , , ,
Companies: youporn

Rate this comment as insightful
Rate this comment as funny
You have rated this comment as insightful
You have rated this comment as funny
Flag this comment as abusive/trolling/spam
You have flagged this comment
The first word has already been claimed
The last word has already been claimed
Insightful Lightbulb icon Funny Laughing icon Abusive/trolling/spam Flag icon Insightful badge Lightbulb icon Funny badge Laughing icon Comments icon

Comments on “How YouPorn Tries To Hide That It's Spying On Your Browsing History”

Subscribe: RSS Leave a comment
Anonymous Coward says:

This exploit is old news, see for instance (which also has a page listing several ways to protect yourself).

This is fixed in Firefox 4, see and for the details. The relevant bug is

If you are still using Firefox 3, the Link Status extension ( has a checkbox to disable the visited link color, and it shows a star on the status bar if the link is visited (so you do not lose the ability to know if you have already visited that link).

Anonymous Coward says:

Re: Re:

I believe NoScript adds Fx4-style “plug the hole without removing the link color changing feature” protections. I know for certain it implements the HTTP Strict Transport Security and X-Frame-Options security features. (In fact, I think it was the second implementation for both of them after the people who proposed them)

NoScript isn’t just JS whitelisting, after all. When you set “Scripts Globally Allowed (dangerous)”, you still get the XSS-filter, clickjacking protection, ABE (protection against router exploits bounced off your browser), etc.

Miles (profile) says:

Old news, but it's still a good refresher.

Ironically, I was working with another “webmaster” trying to correct a cookie issue when he requested of me to ensure my “Remember me” option was checked.

I told him, straight up: “No. It is not my responsibility to leave open a potential security risk for the sake of convenience for either of us. Fix your [removed] cookie problem.”

I find it quite interesting people refuse to take responsibility for their actions when things like this appear.

What, is it really difficult to remember one username and several passwords at various sites? Clean out the browser history upon close? Stop using idiotic add-ons to store sensitive information, such as CC numbers?

When people, using these features, then turn and complain about compromises, I can only think “relish in your own stupidity” because they want short cuts, not responsible actions.

Then again, now that there’s an ever-increasing demand for “password strength” patterns so convoluted they require people to write them down just so they can remember them, I can’t really blame them for using software to remember it for them.

Hence why “webmaster” is now in quotes. Most aren’t masters at all, but idiots.

See you around the next “vulnerability” to laziness.

TheStupidOne says:


I can’t honestly say I’m all that worried. I can’t see any nefarious purposes this information could be used for (I’m sure there is something, but I just don’t see it). While it may be slightly disconcerting that a porn site is tracking my porn browsing history it doesn’t bother me, especially since tracking usually allows a site or service to provide personalized ads or recommendations … How much better would a free porn site be if it immediately knew the 10 best videos to show me?

Anonymous Coward says:


No privacy mode or blocker will stop you from yourself.

If you get to those sites and enable them to watch whatever you want to watch you are disabling the protection those things had to offer.

Flash can access the OS directly and put files in your PC what privacy or security is that?

Same goes to JAVA(not to be confused with Javascript they are different).

Given that porn websites are hostile and many of them will get hacked and carry malicious payloads people should be careful enabling anything in there.

Add Your Comment

Your email address will not be published. Required fields are marked *

Have a Techdirt Account? Sign in now. Want one? Register here

Comment Options:

Make this the or (get credits or sign in to see balance) what's this?

What's this?

Techdirt community members with Techdirt Credits can spotlight a comment as either the "First Word" or "Last Word" on a particular comment thread. Credits can be purchased at the Techdirt Insider Shop »

Follow Techdirt

Techdirt Daily Newsletter

Techdirt Deals
Techdirt Insider Discord
The latest chatter on the Techdirt Insider Discord channel...