Open Authentication Protocol | T. Lodderstedt, Ed. |
Internet-Draft | Deutsche Telekom AG |
Intended status: Experimental Protocol | M. McGloin |
Expires: October 02, 2011 | IBM |
P. Hunt | |
Oracle Corporation | |
A. Nadalin | |
Microsoft Corporation | |
March 31, 2011 |
OAuth 2.0 Security Considerations
draft-lodderstedt-oauth-securityconsiderations-01
This document gives security considerations for the OAuth 2.0 protocol. The proposed text is intended to be included into [I-D.ietf-oauth-v2].
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 02, 2011.
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
This document considers the following clients categories:
Note: This section focuses on the security guidelines implementors of the protocol must consider. We encourage readers to consult the more detailed analysis with additional background information can be found in [I-D.lodderstedt-oauth-security].
Authorization servers MAY issue client secrets to web applications. Application developers MUST ensure confidentiality of client secrets.
Authorization server MUST NOT issue client secrets to native or JavaScript applications. It MAY issue a client secret for an installation of an application on a specific device. Alternatively, authorization servers MUST utilize other means than client authentication to achieve their security objectives.
Authorization servers MUST NOT automatically process (without user interaction) repeated authorizations without authenticating the client.
A malicious client could impersonate a valid client and obtain access to a protected resource.
Assumption: It is not the task of the authorization server to protect the end-user's device from malicious software. This is the responsibility of the platform running on the particular device probably in cooperation with other components of the respective ecosystem (e.g. an application management infrastructure). The sole responsibility of the authorization server is to control access to the end-user's resources living in resource servers and to prevent unauthorized access to them. Based on this assumption, the following countermeasures are recommended.
If the impersonated client is a web application, the authorization server MUST authentication the client. The authorization server SHOULD require clients to pre-register their redirect_uri's and validate the actual redirect_uri against the pre-registered value.
If the impersonated client is an native or JavaScript application, the authorization server MUST utilize other means to achieve its security objectives. The authorization server MAY enforce explicit user authentication or ask the end-user for consent. In this context, the user SHALL be explained the purpose, scope, and duration of the authorization. The authorization server MUST make the meta-data it associates with the particular client (e.g. the Name) available to the end-user . It is up to the user to validate the binding of this data to the particular application and to approve the authorization request.
It is higly RECOMMENDED that the authorization server limits the scope of tokens.
Authorization servers MAY issue refresh tokens to web and native applications.
Refresh tokens MUST only be accessible to the authorization server and the client to whom they have been issued. The authorization server MUST maintain the link between a refresh token and the client to whom it has been issued. Where the client be authenticated, this relation MUST be validated on every token refreshment request. It is RECOMMENDED for authorization servers to implement means to detect abuse of refresh tokens.
Authorization server as well as application developers MUST ensure confidentiality of refresh tokens, on transit and storage.
Authorization servers MUST ensure that refresh tokens cannot be manufactured, modified, or guessed.
Access tokens MUST only be accessible to the authorization server, the target resource servers and the client the token has been issued to. The only exception is the implicit grant where the user agent gets access to the access token that is transmitted in the URI fragment.
Application developers MUST NOT store access tokens in non-transient memory.
Authorization servers MUST ensure that access tokens cannot be manufactured, modified, or guessed.
It is strongly RECOMMENDED that application developers only acquire access tokens with the minimal scope they need in order to implement the respective application function.
The following security sensitive data elements MUST NOT be transmitted in clear: access tokens, refresh tokens, resource owner passwords, authorization codes, and client secrets.
In order to prevent men-in-the-middle and phishing attacks, HTTPS with server-side authentication MUST be implemented and used by authorization servers in all exchanges.
Application developers MUST provide mechanisms to validate the authorization server endpoint's authenticity and ensure proper handling of CA certificates as well as certificate chain validation.
Authorization servers MUST prevent guessing attacks on the following credentials: authorization codes, refresh tokens, resource owner passwords, and client secrets.
When creating token handles or other secrets not intended for usage by human users, the authorization server MUST include a reasonable level of entropy in order to mitigate the risk of guessing attacks.
It is strongly RECOMMENDED that application developers use external browsers instead of browsers embedded in the application for performing the end-user authorization process. External browsers offer a familiar usage experience and a trusted environment, in which users can confirm the authentictity of the site.
To reduce the risk of phishing attacks, authorization servers MUST support the authentication of their endpoint. For example, they can utilize HTTPS server authentication for that purpose. Moreover, service providers should attempt to educate users about the risks phishing attacks pose, and should provide mechanisms that make it easy for users to confirm the authenticity of their sites. e.g. extended validation certificates.
Confidentiality of authorization codes MUST be ensured on transport, even considering browser histories and HTTP referer headers.
The authorization server and the client MUST ensure that the authorization code transmission is protected by using channel security, such as TLS, and that the lifetime of the authorization code is limited.
For web applications, authorization servers MUST authenticate the client and validate that the authorization code had been issued to the same client.
For native applications, authorization servers MUST enforce one time usage of the authorization code. Moreover, if an authorization server observes multiple attempts to redeem an authorization code, the authorization server MAY want to revoke all tokens granted based on this authorization code.
The session fixation attack leverages the authorization code flow in an attempt to get another user to log-in and authorize access on behalf of the attacker. The victim, seeing only a normal request from an expected application, approves the request. The attacker then uses the victim's authorization to gain access to the information unknowingly authorized by the victim.
In order to prevent such an attack, authorization servers MUST ensure that the redirect_uri used in the authorization flow is the same as the redirect_uri used to exchange the respective authorization code into tokens. The authorization server operators SHOULD require client application developers to pre-register their redirect_uri's and validate the actual redirect_uri against the pre-registered value.
The “Resource Owner Password Credentials” grant type is often used for legacy/migration reasons. It reduces the overall risk of storing username and password in the client.
It has higher risk then the other OAuth protocol flows because it maintains the password anti-pattern and the client could abuse the user id and password. Additionally, because the user does not have control over the authorization process, clients using this grant type are not limited by scope, but instead have potentially the same capabilities as the user themselves. The client could also acquire long-living tokens and pass them up to a attacker web service for further abuse.
Authorization servers and application developers SHOULD minimize use of this grant types. Other flows which facilitate user control and transparency should be used instead.
The authorization server SHOULD generally restrict the scope of access tokens issued by this flow.
The authorization server MUST ensure the resource owners control and transparency with respect to all authorizations issued to clients.
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. |
[I-D.ietf-oauth-v2] | Hammer-Lahav, E, Recordon, D and D Hardt, "The OAuth 2.0 Authorization Protocol", Internet-Draft draft-ietf-oauth-v2-22, September 2011. |
[I-D.lodderstedt-oauth-security] | Lodderstedt, T, McGloin, M and P Hunt, "OAuth 2.0 Threat Model and Security Considerations", Internet-Draft draft-lodderstedt-oauth-security-01, March 2011. |