Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: neoLsH The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @neoLsH! |
--git-config, --git-config-add and the startup 'git config' dump print http.extraHeader values verbatim, and that header is the documented way to pass a token. Redact extraHeader values and password-bearing URLs in url.<base>.insteadOf keys in all three places, including the error path when a config fails to apply.
4165c05 to
d8afbd1
Compare
--git-config,--git-config-addand thegit configdump printed at startup all echohttp.extraHeadervalues verbatim, and that header is the documented way to pass a token. So any of those log lines leaks it.This redacts, in all three places:
http.extraHeaderandhttp.<url>.extraHeadervaluesurl.<base>.insteadOf/.pushInsteadOfkeys and valuesThe
--git-configflags are re-rendered from the parsed key/value pairs before logging. If a value can't be parsed, it is redacted wholesale, since we can't tell which part is sensitive.SetupExtraGitConfigsalso redacts the config it logs when applying fails.End-to-end check with a throwaway repo: the startup line shows
--git-config=http.extraHeader:REDACTED, the config dump shows"http.extraheader":"REDACTED", and grepping the log for the token comes back empty. The command trace at-v=5still prints the command as it runs, that part is unchanged.Tests cover key/value redaction, the parsed dump, and
logSafeFlagsfor both flags.Fixes #1013