Giter VIP home page Giter VIP logo

hsts-supercookie's Introduction

HSTS-SuperCookie

Storing data as HSTS super-cookies is a topic that has come up several times in the past. This simple HTML file along with proper setup with nginx demonstrates that, thankfully, this is no longer an issue, since most major browsers now use separate HSTS sets for incognito modes. @ben174's hsts-cookie repo has a nice explanation of something similar.

However, it still is a super cookie, in the sense that deleting all history and wiping cache etc. will not clear it. Still, it is better than being tracked while in incognito.

Demo

A demo found here was working as of writing this! If you set some data, it should be accessible after you refresh the page, but will vanish if you open incognito/private mode.

Working

The domains used are #.hsts.your-site.com, where # is the index of the binary bit. The client makes JSONP requests to nginx, which responds with 1 as a parameter to a function if https was used to call the request, and 0if not. The client can set the data by calling https://URL/set, which will return the HSTS header, forcing an https call next time. This data is then parsed.

Background

At the time I write this, Wikipedia noted that HSTS can potentially have privacy issues, with HSTS being enabled being possibly used as a store of super-cookies. While I could find references that it had been fixed in most browsers that incognito modes used a different HSTS set, I just had to be sure!

Testing

I've tested that the hack doesn't work on Edge 16, Firefox 58, Chrome 64.0.3282.186 and the Safari on my iPad, whose version I'm unsure about.

hsts-supercookie's People

Contributors

pulsejet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.