How secure is Oauth 2.0 Implicit Grant?

隐身守侯 提交于 2019-11-28 20:51:03

Elaborating on @vlatko's response...

To mitigate the risk of sending the token in the fragment (or via any other OAuth2 grant):

Issuing short-lived access token (as @vlatko said) will reduce the impact of a leaked token, but is not a preventative measure.

Hmmm, I am afraid there are some misunderstandings in the answers above. While URL query strings are secured when using TLS, and thus the access token is protected in flight, it is exposed in the users browser (part of their history) and also in the destination web browser logs. Most web browsers will log the entire URL of the incoming request. Their is an additional issue known as the "referer" leak problem wherein the query string will be passed to third-party sites. A good overview may be found at:

http://blog.httpwatch.com/2009/02/20/how-secure-are-query-strings-over-https/

Like you pointed out, the token is passed the URI fragment. Since browsers don't send fragments of URLs to HTTP servers, the chances that someone will eavesdrop and pick up the access token are drastically reduced.

There are also additional security measures, like only issuing short lived access tokens in the implicit grant flow.

More info in the OAuth2 threat models document.

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