-
-
Notifications
You must be signed in to change notification settings - Fork 933
Github token is leaked when used as a part of remote URL #1284
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
Thanks for reporting. That's interesting because passwords are already removed from URLs, at least supposedly so. Which version of GitPython are you using? In case it's not the latest one, is the issue still reproducible with the most recent one? |
Hello @Byron. I'm using version Line 404 in 0a6d9d6
url.password part, while in the URL which Github is using, token is located at the username part, here is a run proof https://onecompiler.com/python/3x4mtarsc
|
Thanks a lot for following up so quickly. I see that even though more recent version of GitPython do better, they are still not equipped to hide all secrets. |
I would agree that usernames can be considered as sensitive info as well and it is better to remove it (threat actor may collect user names by grabbing the logs and it will the simplify bruteforce attacks). Although it may be needed for the debugging, but I guess users can check the username they use in the URL before passing it to |
From Github: "Support for password authentication was removed on August 13, 2021. Please use a personal access token instead." |
|
Github allows usage of personal access tokens with remote URLs in the format:
or
If such URL is used with
Remote
, if some error related to the access happens, it (in the example below token isfoobar
) can be leaked via exception message, like the following:It would be nice to have internal mechanism to prevent such leakage.
The text was updated successfully, but these errors were encountered: