Jump to content
Nytro

HSTS Super Cookies

Recommended Posts

Posted

HSTS Super Cookies

2 January 2015

Websites could use a security feature of your iPad to track your browsing even if you clear the browser history.

Demonstration

Your tracking id was read. dbgies

This is a unique value that was generated by JavaScript in this page. The page attempts to store this value in your web browser and read it again when you visit the page in the future.

Different web browsers don't behave exactly the same way. To see how your browser performs try these tests and see if the value stays the same:

  • Refresh the page.
  • Open the same web address in a "private"/"incognito" window.
  • Clear your browser cookies and refresh the page.
  • Visit the page on a different iOS device, synced with the same iCloud account.

If the value stays the same during any of these steps this technique could be used to track your browsing habits.

It's a well observed tip to make sure you're using a secure connection whenever you visit a website where you might share sensitive or personal information. When you're visiting a website with a secure connection your web browser displays a padlock icon. The icon indicates that your connection to the site is encrypted and can't be interfered with or intercepted.

A security feature of modern web browsers called "HTTP Strict Transport Security" (HSTS) allows a website to indicate that it should always be accessed using a secure connection. If you visit a site that has HSTS enabled, your web browser will remember this flag and ensure the connection is secure any time you visit the website in the future. Subsequent visits to the site without using a secure connection get automatically redirected by the web browser to the secure variant of the web address, beginning https://

This automatic redirecting protects your access to the site from being intercepted but could also be abused by a malicious site to store a unique number to track your web browser. A number can be encoded as a series of bits (true and false values) and stored by accessing a set of web addresses. Each web address responds with HSTS enabled or disabled depending on the address. Once the number is stored it could be read by other sites in the future. Reading the number just requires testing if requests for the same web addresses are redirected or not.

Using HSTS to track your browsing habits evades the features of web browsers designed to control more normal "cookie" based tracking mechanisms. Using "incognito" or "private" modes means that existing cookies won't be shared with sites you visit. Browsers also let you entirely delete cookies that could be used to track you.

Because HSTS is a security feature and isn't intended to be used for tracking, web browsers treat it differently from cookies. It is only by intentional misapplication that HSTS can be exploited to track users.

Some browsers such as Google Chrome, Firefox and Opera do mitigate the issue. Erasing cookies on these browsers also erases HSTS flags so any stored value will be cleared. However, unlike cookies, existing HSTS flags are still shared with sites when using "incognito" or "private" windows. The impact is that it's possible for a site to track you even if you choose to use "incognito" or "private" browsing features in an effort to avoid such tracking.

Considerably more worrying is the behavior displayed by Safari, the default browser for iPad and iPhone. When using Safari on an Apple device there appears to be no way that HSTS flags can be cleared by the user. HSTS flags are even synced with the iCloud service so they will be restored if the device is wiped. In this case the device can effectively be "branded" with an indelible tracking value that you have no way of removing.

A notable exception is Internet Explorer which has no support for HSTS (although it is in development at the time of writing) so it's not vulnerable to this technique.

I initially thought this wasn't an avenue that had previously been explored, However Mikhail Davidov wrote about the potential misuse of HSTS in April 2012 although I'm not aware of any direct response to his observations by browser vendors.

I'm not aware of the technique being used to track users in the wild, although that is not to say it isn't. I'd like to reach out to the rest of the technical community to consider how this might be mitigated while still deriving as much value from HSTS as possible. If you would like to get in touch regarding this information please email me at sam-hsts-sc@radicalresearch.co.uk

Update

4 January 2015 Members of he Google Chrome security team have been kind enough to highlight the discussions that have lead to a number of patches, and reverts to the chromium code base in attempts to mitigate the effects of the problem this article demonstrates. You can read more here and here

Ultimately they conclude that there is a necessary trade-off between security and privacy. The chromium security FAQ goes on to say that "defeating such fingerprinting is likely not practical without fundamental changes to how the Web works".

The Technical analysis of client identification mechanisms talks about the possibility of this technique, along with many others, saying "In an attempt to balance security and privacy, any HSTS pins set during normal browsing are carried over to the incognito mode in Chrome; there is no propagation in the opposite direction, however."

Update

7 January 2015 The release of version 34.0 of Firefox seems to have changed. Unlike Google Chrome, Firefox has chosen to prefer privacy over security and no longer carries HSTS over to private windows.

Robert "RSnake" Hansen points out that he raised concerns about this possibility on his blog ha.ckers.org when implementations of the HSTS were in their infancy.

Sursa: RadicalResearch HSTS Super Cookies

  • Upvote 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...