Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Facebook Login Security

Facebook Login Security

Kien Nguyen

November 01, 2017
Tweet

More Decks by Kien Nguyen

Other Decks in Programming

Transcript

  1. Use client to get facebook data graph.facebook.com/me fb access token

    1 user ’s facebook id 2 facebook_id 3 your server
  2. Use client to get facebook data graph.facebook.com/me fb access token

    1 user ’s facebook id 2 facebook_id 3 your server your database get or insert base on facebook_id 4
  3. Use client to get facebook data graph.facebook.com/me fb access token

    1 user ’s facebook id 2 facebook_id 3 your server your database site access token 5 5 get or insert base on facebook_id 4
  4. fake facebook_id 3 your server your database site access token

    5 5 get or insert base on facebook_id 4 attacker Attacker only need to know facebook_id
  5. Use server to get facebook data your server fb access

    token 1 graph.facebook.com/me get user data 2 user facebook_id 3
  6. Use server to get facebook data your server fb access

    token 1 graph.facebook.com/me your database get user data 2 user facebook_id 3 get or insert 4
  7. Use server to get facebook data your server fb access

    token 1 graph.facebook.com/me your database site access token 5 5 get user data 2 user facebook_id 3 get or insert 4
  8. Attacker use fake access token your server fake access token

    1 graph.facebook.com/me your database site access token 5 5 get user data 2 user facebook_id 3 get or insert 4 attacker
  9. Attacker use fake access token your server fake access token

    1 graph.facebook.com/me your database site access token 5 5 get user data 2 user facebook_id 3 get or insert 4 attacker other fb application a valid facebook token
  10. How to fix? your server fb access token 1 graph.facebook.com/me

    your database site access token 5 6 get user data 3 user facebook_id 4 get or insert 5 graph.facebook.com validate fb access token 2
  11. Conclusion Do not use client to get facebook user data

    Use /debug_token to check access token is from your application
  12. Remember Do not use client to get facebook user data

    Use /debug_token to check access token is from your application TRUST CIRCLE IS HIRING