Skip to content

fix: Keep GitHub token out of git source URLs - #608

Closed
alecthomas wants to merge 1 commit into
masterfrom
aat/redact-github-token-urls
Closed

fix: Keep GitHub token out of git source URLs#608
alecthomas wants to merge 1 commit into
masterfrom
aat/redact-github-token-urls

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

The token was embedded in the source URL, so it reached every consumer
that treats that URL as an identifier: command lines in logs and error
messages, the UI task label, hermit status output, the source directory
hash, and remote.origin.url in the cloned repository's .git/config,
where it persisted indefinitely and was reused on every pull.

Pass it to git as an http.extraheader via GIT_CONFIG_* environment
variables instead. The environment keeps it out of argv as well as out
of .git/config, so all of those sinks close at once. Redacting URL
userinfo where commands and sources are displayed covers the remaining
case of credentials a user hand-writes into sources.

DX-26

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

The token was embedded in the source URL, so it reached every consumer
that treats that URL as an identifier: command lines in logs and error
messages, the UI task label, hermit status output, the source directory
hash, and remote.origin.url in the cloned repository's .git/config,
where it persisted indefinitely and was reused on every pull.

Pass it to git as an http.extraheader via GIT_CONFIG_* environment
variables instead. The environment keeps it out of argv as well as out
of .git/config, so all of those sinks close at once. Redacting URL
userinfo where commands and sources are displayed covers the remaining
case of credentials a user hand-writes into sources.

DX-26

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@alecthomas alecthomas closed this Aug 13, 2026
@alecthomas

Copy link
Copy Markdown
Collaborator Author

A correct implementation of this is quite tricky, and the risk is relatively low.

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

Successfully merging this pull request may close these issues.

1 participant