Giter Site home page Giter Site logo

corf-token-fixation's Introduction

Introduction

Attacking CSRF Synchronizer Token Pattern (STP) in the context of same-site attackers.

More info @ https://www.usenix.org/conference/usenixsecurity23/presentation/squarcina.

Usage

  • Set in your /etc/hosts/ file two different entries, both pointing to 127.0.0.1, with a same-site relationship (e.g. victim.tld and attacker.victim.tld).
  • Install flask, flask-login and flask-wtf.
  • Run the two app.py files, and explore the attack described in the paper for flask-login (CORF Token Fixation).

Attack Steps

  1. The web application is running at victim.tld:5000.
  2. The hacker runs its malicious app at attacker.victim.tld:8000.
  3. The hacker tricks the victim browser into visiting https://attacker.victim.tld:8000/cookie. When doing this, the malicious app will fetch a "guest" session and a valid CSRF token from the web application, and it will inject the session fetched with a cookie scoped to the domain victim.tld into the victim browser.
  4. Now, when the victim visits https://victim.tld:5000/login to login, it will present the injected cookie to the login page. The CSRF secret will be therefore be persisted even after logging in.
  5. The hacker now tricks the victim browser into visiting https://attacker.victim.tld/csrf, where a CSRF attack to steal money is mounted with the CSRF token computed on the guest session fetched earlier. The victim browser sends the request, and the CSRF token is valid for the victim session!

corf-token-fixation's People

Contributors

suidpit avatar

Stargazers

 avatar  avatar

Watchers

 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.