Vulnerability with Facebook token hijacking

吃可爱长大的小学妹 提交于 2019-12-01 18:19:41

These types of vulnerability are application specific - one scenario I can think of is this:

Imagine you are using Facebook authentication as a SSO mechanism and have created an app with a webservice that returns some private information to authenticated users. This webservice is called /secretdocuments/download which takes an access token as a parameter.

If the webservice only checks that the access token it receives is for a user it has in the database (via a call to /me and then a DB lookup), then a malicious person could:

  1. Create some other "bait" app.
  2. Send a link to that app to one of your users and encourage them to install it.
  3. That user authenticates with the bait app and an access token is generated. The bait app sends this access token to the malicious user.
  4. The malicious user takes that access token and calls your /secretdocuments/download webservice with it.
  5. Your webservice only checks that the access token is for a user which is in the database and returns the private information to the malicious user.

In this scenario, your webservice must check that the access token provided was generated by your application.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!