Skip to content
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

README recommends dangerous usage of deeplink redirects containing access token #440

Open
macmccann opened this issue Nov 7, 2023 · 1 comment

Comments

@macmccann
Copy link

macmccann commented Nov 7, 2023

As detailed in Stytch's blog post on PKCE and You're probably doing oauth wrong on android, there are still vulnerabilities with deeplink redirection even when using App-claimed https scheme redirects.

The README implies that the URL returned from openAuth should return a long-term access token via the lines
// Validate the stored access token (Maybe with a request)
and

if (code) {
    // Get and Save the access token request, user info...
}

This is dangerous for developers who don't understand the OAuth flow as they may be tempted to return the permanent access token from a successful web OAuth authorization flow, which could be intercepted by a malicious developer and used to gain access to client resources.

The current gold standard for OAuth2.0 is to return an authorization code in the deeplink redirect and PKCE to exchange for the true access token. The openAuth documentation should ensure developers know this, preferably with some scary language in the example portion of the code around deeplinking, e.g. "DO NOT return any permanent secret tokens in this deeplink redirect!"

@jdnichollsc
Copy link
Member

@macmccann hello mate, thanks for reporting this issue, any PR is welcome! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants