Security: GitHub token embedded in clone URL may leak credentials#340
Open
tuanaiseo wants to merge 1 commit intozilliztech:masterfrom
Open
Conversation
The repository cloning logic constructs an HTTPS URL containing the raw GitHub token (`https://<token>@github.com/...`). Tokens embedded in URLs can leak through process listings, crash logs, shell history, proxy logs, or be persisted in `.git/config` as the remote origin URL. Affected files: file_management.py Signed-off-by: tuanaiseo <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The repository cloning logic constructs an HTTPS URL containing the raw GitHub token (
https://<token>@github.com/...). Tokens embedded in URLs can leak through process listings, crash logs, shell history, proxy logs, or be persisted in.git/configas the remote origin URL.Severity:
highFile:
evaluation/utils/file_management.pySolution
Avoid embedding credentials in URLs. Use Git credential helpers,
GIT_ASKPASS, or authenticated headers/SSH deploy keys. If HTTPS tokens must be used, ensure they are not persisted in remotes and scrub/redact them from all logs.Changes
evaluation/utils/file_management.py(modified)Testing