-
Notifications
You must be signed in to change notification settings - Fork 2.1k
GitHub OAuth client vulnerable to client impersonation #1195
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
Comments
cc. @hpsin |
@hickford when reporting potentially critical security issues, do consider to report them responsibly, i.e. non-publicly. See https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability for better ways to report vulnerabilities. |
Hi @hickford , this is a good call out. I'll update the documentation here - we just updated them and some guidance was taken a bit stringently. GitHub splits functionality into two categories:
Primarily, the reason we haven't prioritized a dedicated native client flow for OAuth apps is that it doesn't change anything meaningfully except for some dual native+web apps with redirect bugs. We're focusing on making GitHub apps better so that they can ultimately replace Oauth apps. We will be fixing some of the valid issues you call out, such as automatic redirection to public clients - that's on my table for this quarter. |
@hpsin Brilliant, I agree that's the most important issue. So OAuth client registration will include a choice of public/confidential client type? |
@dscho Thanks, agreed. I didn't consider this a vulnerability discovered but "a reminder to follow the spec for the reasons discussed in the spec". |
We won't be adding a public/confidential option with this work - instead, we’ll be looking at redirect urls to determine what's being sent to a native client, so that this applies retroactively to all clients. |
@hpsin Thanks for clarifying. I urge you to follow the spec closely https://datatracker.ietf.org/doc/html/rfc8252#section-8.4
You suggest:
I introduced (and later fixed) a similar assumption in https://github.com/go-gitea/gitea/ . A problem is
|
Yep, when I owned OAuth at Microsoft we had similar problems, and we spent a good bit of time talking to Google, Windows, and Apple about universal URIs. It's why Microsoft apps support per-URI distinction instead of per-client-ID. We have longer term plans to introduce client type distinctions for GitHub, but for now, it's a targeted fix using just the URI. OS-bound HTTP redirects offer a decent bit more security than native redirects - both Apple and Google let you leverage your DNS entries to restrict the apps that can take over an HTTP URI, so the danger there is reduced (the third section of 8.4). Thanks for calling these out, and putting together the tables documenting compliance across various AS. I know I found that useful when discussing changes we should be making on our platforms. |
Closing as there is no work to be done on the GCM side to correct this. |
Brilliant, I look forward to that |
Like any OAuth native app, Git Credential Manager's OAuth client credentials are necessarily stored in the application's source code, eg. for GitHub
git-credential-manager/src/shared/GitHub/GitHubConstants.cs
Lines 15 to 16 in dc1edca
OAuth authorization servers are supposed to distinguish between public clients and confidential clients:
However GitHub assumes all OAuth clients to be confidential clients:
This leaves public clients vulnerable to attacks such as client impersonation. In particular:
Git Credential Manager's OAuth credentials would be an attractive target because very many users have previously authorized it.
Fixing this issue requires upstream changes in GitHub.
See also hickford/git-credential-oauth#17 for further comparison of OAuth servers.
The text was updated successfully, but these errors were encountered: