-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/token endpoint should validate redirect_uri matches #209
Copy link
Copy link
Open
Labels
P0Broken core functionality, security issues, critical missing featureBroken core functionality, security issues, critical missing featureauthIssues and PRs related to Authentication / OAuthIssues and PRs related to Authentication / OAuthbugSomething isn't workingSomething isn't workingfix proposedBot has a verified fix diff in the commentBot has a verified fix diff in the commentready for workEnough information for someone to start working onEnough information for someone to start working on
Metadata
Metadata
Assignees
Labels
P0Broken core functionality, security issues, critical missing featureBroken core functionality, security issues, critical missing featureauthIssues and PRs related to Authentication / OAuthIssues and PRs related to Authentication / OAuthbugSomething isn't workingSomething isn't workingfix proposedBot has a verified fix diff in the commentBot has a verified fix diff in the commentready for workEnough information for someone to start working onEnough information for someone to start working on
Describe the bug
The
/tokenendpoint doesn't check that theredirect_uriprovided in the request matches theredirect_urioriginally provided in the/authorizerequest, which is required by https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3.This seems like a problem with the way the AuthProvider interface is designed - the only method the provider can expose is
challengeForAuthorizationCode, so there's no way for the provider to tell the SDK whatredirect_uriwas originally provided. Fixing this will require a change to the interface (and the cleanest way to fix it is a breaking change), so we should probably fix this before too many integrations grow around the existingAuthProviderinterface.To Reproduce
Steps to reproduce the behavior:
/authorizerequest/tokenrequest with a differentredirect_uri; this returns a successful response.Expected behavior
The
/tokenrequest should return an HTTP 400 witherror=invalid_grant(https://datatracker.ietf.org/doc/html/rfc6749#section-5.2).