Rogue websites exploit flaw to track your web history

Researchers uncover detailed "history sniffing" practices at hundreds of Websites.

Be careful the next time you visit some of the Web's most popular porn, news, and torrent sites as they could be peeking at your browser history without your consent. Researchers at University of California, San Diego have discovered that 485 of the 50,000 most popular Websites in the world are exploiting a flaw that lets them read your browser's Web history. The offending sites include,,, and, according to the researchers.

Called history sniffing, the combination of JavaScript and Cascading Style Sheet (CSS) properties enables the sites to figure out where you've been on the Web. The researchers' findings are published in a new study entitled "An Empirical Study of Privacy-Violating Information Flows in JavaScript Web Applications."

If you want to make sure you're protecting your Web browsing history from bad actors, read on to learn how history hijacking is done and how you can prevent it.

History Sniffing

CSS is a Web development language that controls many elements of a Web page's layout and is a commonly used tool among Web developers. One property of CSS is the "a:visited" property that displays visited Web links in a different color (typically purple) from links you haven't visited (typically blue). These properties are stored by your browser so that it can display the appropriate color for every link you come across on the Web.

What history hijackers do to find out where you've been is hide on their Web pages some invisible Web links to third-party sites such as Amazon, Twitter, and Facebook. Then the spying sites use a snippet of JavaScript code to find out from your browser what color the hidden links should have. After that's done, it's pretty straightforward to create a list of sites your browser has visited and sites it hasn't.

Who's Tracking

Although the researchers found 485 sites are exploiting the history-sniffing flaw, 46 of those sites are actively downloading your browser history. The researchers also found that another 17 sites for a total of 63 are transferring your browsing history to their network, but couldn't confirm the sites were using the information collected. The majority of sites, according to the UC San Diego researchers, are only inspecting the style properties and nothing more.

Reading over the researcher's findings, it's amazing to see how many hidden links are used by each site. About 18 of the offending 46 sites, such as,, and, are using the exploit to analyze your past visits to more than 220 sites., an amateur porn site and one of the 100 most visited sites on the Web, analyzes your browsing history for more than 21 sites, according to the researchers.

History sniffing is nothing new, but the UC San Diego study shows just how prevalent this exploit is. The researchers even say that some Web analytics companies such as Tealium and Beencounter provide history-sniffing services to their clients.

History-Sniffing Implications

It's easy to get carried away with the fear that your browsing history could be used for some nefarious purpose. One possibility could be building a profile about you based on your browsing history and other information collected by the site.

But there are also more benign uses of history sniffing that can actually make your browsing experience better, some Web developers argue. Blogger and Web developer Niall Kennedy points out that you can use history sniffing to determine which social networking sites you visit and show you "share" or "like" buttons only for those specific sites. Other uses include targeting you with your favorite blog aggregation service such as Google Reader and Netvibes, instead of showing you every RSS reader link on the planet. Or displaying mapping services you are more likely to use, such as Google Maps or MapQuest when you click a "show map" link.

There's no question, however, that having a Website target you in such a specific way can, as Google CEO Eric Schmidt might say, "cross the creepy line."

If you don't want your history sniffed or hijacked, there are several things you can do. Many modern browsers, including Google Chrome, Apple Safari, and Mozilla Firefox are able to defend against history sniffing. Internet Explorer may also defend against this attack if you use the browser in private browsing mode. If you want to make sure you are completely protected, you could also use the Firefox browser add-on NoScript that prevents sites from running JavaScript in your browser. Firefox users could also disable CSS visited links by modifying the browser's about:config file.

In addition to history sniffing, the UC San Diego researchers also looked at how major sites such as YouTube and The Huffington Post use scripts to track your mouse pointer movements. You can find the complete study here.

Connect with Ian Paul (@ianpaul) and Today@PCWorld on Twitter for the latest tech news and analysis.

Join the CSO newsletter!

Error: Please check your email address.

Tags securityUniversity of CaliforniaSan Diego

More about Amazon Web ServicesAppleEmpiricaletworkFacebookGoogleMozilla

Show Comments

Featured Whitepapers

Editor's Recommendations

Solution Centres

Stories by Ian Paul

Latest Videos

  • 150x50

    CSO Webinar: The Human Factor - Your people are your biggest security weakness

    ​Speakers: David Lacey, Researcher and former CISO Royal Mail David Turner - Global Risk Management Expert Mark Guntrip - Group Manager, Email Protection, Proofpoint

    Play Video

  • 150x50

    CSO Webinar: Current ransomware defences are failing – but machine learning can drive a more proactive solution

    Speakers • Ty Miller, Director, Threat Intelligence • Mark Gregory, Leader, Network Engineering Research Group, RMIT • Jeff Lanza, Retired FBI Agent (USA) • Andy Solterbeck, VP Asia Pacific, Cylance • David Braue, CSO MC/Moderator What to expect: ​Hear from industry experts on the local and global ransomware threat landscape. Explore a new approach to dealing with ransomware using machine-learning techniques and by thinking about the problem in a fundamentally different way. Apply techniques for gathering insight into ransomware behaviour and find out what elements must go into a truly effective ransomware defence. Get a first-hand look at how ransomware actually works in practice, and how machine-learning techniques can pick up on its activities long before your employees do.

    Play Video

  • 150x50

    CSO Webinar: Get real about metadata to avoid a false sense of security

    Speakers: • Anthony Caruana – CSO MC and moderator • Ian Farquhar, Worldwide Virtual Security Team Lead, Gigamon • John Lindsay, Former CTO, iiNet • Skeeve Stevens, Futurist, Future Sumo • David Vaile - Vice chair of APF, Co-Convenor of the Cyberspace Law And Policy Community, UNSW Law Faculty This webinar covers: - A 101 on metadata - what it is and how to use it - Insight into a typical attack, what happens and what we would find when looking into the metadata - How to collect metadata, use this to detect attacks and get greater insight into how you can use this to protect your organisation - Learn how much raw data and metadata to retain and how long for - Get a reality check on how you're using your metadata and if this is enough to secure your organisation

    Play Video

  • 150x50

    CSO Webinar: How banking trojans work and how you can stop them

    CSO Webinar: How banking trojans work and how you can stop them Featuring: • John Baird, Director of Global Technology Production, Deutsche Bank • Samantha Macleod, GM Cyber Security, ME Bank • Sherrod DeGrippo, Director of Emerging Threats, Proofpoint (USA)

    Play Video

  • 150x50

    IDG Live Webinar:The right collaboration strategy will help your business take flight

    Speakers - Mike Harris, Engineering Services Manager, Jetstar - Christopher Johnson, IT Director APAC, 20th Century Fox - Brent Maxwell, Director of Information Systems, THE ICONIC - IDG MC/Moderator Anthony Caruana

    Play Video

More videos

Blog Posts