git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] docs: indicate clearly that http.extraheader is not for creds

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 23, 2026, 16:24 UTC
Message-ID
<xmqq5wxnbjod.fsf@gitster.g>
In-Reply-To
<20261123011744.723147-1-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> People frequently use http.extraheader for credentials, but it is not

Use camelCase `http.extraHeader` here, to match config/http.adoc and what git.adoc used to say before you removed its mention.

Show 7 quoted lines
> intended for that and is easy to misuse.  People using it for
> credentials often do not use the URL-qualified option, exposing their
> credentials to every server Git connects to, or they specify it on the
> command line or in the config file, potentially exposing it to other
> users or to anyone who accesses the repo, respectively.
>
> It's also known that using http.extraheader for the Authorization header
Ditto.
Show 8 quoted lines
> breaks some uses of Git LFS, where some parts of the protocol can
> include their own Authorization header.  This is because that tool does
> as Git does and always adds the header, leaving two Authorization
> headers which breaks authentication.  However, using a credential helper
> works fine, since Git LFS only calls the credential helper if it doesn't
> have credentials.
>
> Indicate clearly that http.extraheader should not be used for
Ditto.
Show 19 quoted lines
> credentials now that we have more robust credential helper support.
> Remove text that suggests it might have sensitive information in it,
> since it should not.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> ...
> diff --git a/Documentation/config/http.adoc b/Documentation/config/http.adoc
> index 792a71b413..d61180c909 100644
> --- a/Documentation/config/http.adoc
> +++ b/Documentation/config/http.adoc
> @@ -111,6 +111,14 @@ http.extraHeader::
>  	more than one such entry exists, all of them are added as extra
>  	headers.  To allow overriding the settings inherited from the system
>  	config, an empty value will reset the extra headers to the empty list.
> ++
> +Note that this option should not be used to pass credentials and using it for
> +that purpose may cause security issues.  Using this option for the
> +Authorization header can also break some external tools.
Do we want the word in monospaced backquotes `Authorization`?
> ++
> +A credential helper is almost always more secure and does not impact external
> +tools negatively; note that modern credential helpers can implement any
> +reasonable method of authentication, including Bearer.

Do we want to linkgit:gitcredentials[7] somewhere, like the entry for http.proxy does?

Show 11 quoted lines
> diff --git a/Documentation/gitfaq.adoc b/Documentation/gitfaq.adoc
> index b26e4e3a09..5bc33f7e26 100644
> --- a/Documentation/gitfaq.adoc
> +++ b/Documentation/gitfaq.adoc
> @@ -120,7 +120,8 @@ them for a certain period of time.
>  You can also just enter your password when prompted.  While it is possible to
>  place the password (which must be percent-encoded) in the URL, this is not
>  particularly secure and can lead to accidental exposure of credentials, so it is
> -not recommended.
> +not recommended.  For similar reasons, we don't recommend using the
> +`http.extraheader` option for credentials, either.
Ditto on camelCase `http.extraHeader`.
Previous: brian m. carlsonNext: brian m. carlson
Message 4 of 5 in “docs: indicate clearly that http.extraheader is not for creds”
  1. docs: indicate clearly that http.extraheader is not for credsbrian m. carlson, Nov 21, 2026
  2. Junio C HamanoNov 22, 2026
  3. docs: indicate clearly that http.extraheader is not for credsbrian m. carlson, Nov 23, 2026
  4. Junio C HamanoNov 23, 2026
  5. docs: indicate clearly that http.extraHeader is not for credsbrian m. carlson, Nov 24, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.