Coder Social home page Coder Social logo

oauth2-redirector's Introduction

oauth2-redirector

Utility for testing OAuth2 CSRF vulnerabilities

The OAuth2 specification lists the state parameter as optional even though it is an important protection against Cross Site Forgery Requests. This has been known for a long time but is an easy mistake to make when integrating OAuth without a library. This lead to a Vimeo account takeover vulnerability in Feb 2015.

This project sets up a server that helps automate testing of this vulnerability. The redirect.rb server responds to HTTP requests by opening Firefox, logging into Facebook, and attempting to authorize a given application (CONNECT_URI). Once authorized, the script will intercept Facebook's redirect and respond to the original HTTP request with a redirect to the URL from Facebook.

This helps remove many of the repetative steps of testing for OAuth CSRF vulnerabilities and provides a nice starting point for developing a proof of concept exploit.

This project relies on the noredirect Firefox extension to manually step through 302 redirects.

Usage

The following environment variables must be set:

  • CONNECT_URI The facebook connect URI
  • REDIRECT_URI The URI to block and reflect back to victim
  • FB_USER The attacker's facebook username
  • FB_PASS The attacker's facebook password
CONNECT_URI='https://www.facebook.com/v2.1/dialog/oauth?client_id=19884028963&redirect_uri=https%3A%2F%2Fvimeo.com%2Fsettings%2Fapps%3Faction%3Dconnect%26service%3Dfacebook&scope=email,public_profile,publish_actions,user_friends' REDIRECT_URI='https://vimeo.com' FB_USER='facebookusername' FB_PASS='facebookpassword' ruby redirect.rb

oauth2-redirector's People

Contributors

tam7t avatar

Watchers

James Cloos avatar Julian Lugod 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.