-
-
Notifications
You must be signed in to change notification settings - Fork 931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Security Vulnerabilities in Auth and Token Endpoint #637
Multiple Security Vulnerabilities in Auth and Token Endpoint #637
Comments
Hi there, Thanks for the detailed work you've done here - ...
This appears to me to conform to the spec, please let me know if I'm missing something.
Perhaps it would be wise for us to make point out this requirement for the implementor to comply with the spec exactly in the documentation. I can also see there's a couple of places in the docs that show the Again, please let me know if I'm overlooking something. |
The spec say not only authorisation code must be invalidated, but also the tokens issued from that autorisation code.
But the spec specify |
It is true that once the authorization code is exchanged for an access token, that code is revoked. which prohibits obtaining a new token with the same code. However, what if the client requests a new authorization code, when it has already obtained an access token still valid? From my point of view, the access tokens should be revoked when client request a new authorization code. What do you think about this? Best regards. |
Am I understanding this correctly? The described vulnerability due to the missing PKCE feature only applies to mobile/desktop apps(!) which are able to register custom URI schemes in the OS, so that a malicious app can register itself for a URI scheme used by a legit app and receive the authorization code instead? So, if the redirect URI is set to a custom URI scheme, e.g. This does not apply to browser-based OAuth2 client applications, does it? |
I guess, you first call revokeAuthorizationCode and then check if the redirect_uri is valid. |
This is a small security issue if I understood bluebirds tap method correctly. I think we should revoke the AuthorizationCode much much earlier, by moving the revokeAuthorizationCode call above the redirectUri check. An attack on the authorizationCode grant is usually based on a malicious redirect_uri. So if the authorization code is valid, we load the token, then tap on validateRedirectUri, and if the redirect_uri is invalid, we error and we are not calling revokeAuthorizationCode. So the authorizationCode is still existing despite it was used already. |
I would like to report several security vulnerabilities that I found while using this OAuth server library.
The vulnerabilities and their consequences are listed as following:
Vulnerability 1: Missing PKCE support for public clients.
Consequences: As specified in RFC-7636 (https://tools.ietf.org/html/rfc7636), public clients (e.g., mobile/desktop apps) using Authorization Code Flow are susceptible to authorization code interception attack and PKCE is recommended to mitigate this attack. Since public clients cannot maintain client-side confidentiality regarding client secrets, such attacks have been noticed in the wild extensively.
Vulnerability 2: Does not revoke previously issued token if authorization_code is used more than once.
Consequences: As specified in RFC-6749 (https://tools.ietf.org/html/rfc6749#section-4.1.2), If an authorization code is used more than once, the authorization server must deny the request and should revoke all tokens previously issued based on that authorization code. Though OAuth2-server currently denies the request in such cases, it doesn't revoke the tokens issued previously to the client, which leaves the user's resources vulnerable as attackers might exploit the previous tokens to get them.
Vulnerability 3: Allows fragment in the redirect URI.
Consequences: Many OAuth attacks regarding misuse of redirect uris have been observed in the wild. As specified in the RFC-6749 (https://tools.ietf.org/html/rfc6749#section-3.1.2), authorization server should not allow fragments in the redirect uri as it allows the attackers to exploit the redirect uri and hence intercept the auth_code/token.
Any comments or fixes regarding these vulnerabilities?
Thank you.
The text was updated successfully, but these errors were encountered: