{"thread":{"id":"66910","subject":"[PATCH] docs: indicate clearly that http.extraheader is not for creds","startedAt":"2026-11-21T22:27:23Z","lastAt":"2026-11-24T22:56:56Z","messageCount":5,"participants":["brian m. carlson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"559068","messageId":"20261121222723.23714-1-sandals@crustytoothpaste.net","threadId":"66910","inReplyTo":null,"subject":"[PATCH] docs: indicate clearly that http.extraheader is not for creds","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-11-21T22:27:23Z","receivedAt":"2026-11-21T22:27:23Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"People frequently use http.extraheader for credentials, but it is not\nintended for that and is easy to misuse.  People using it for\ncredentials often do not use the URL-qualified option, exposing their\ncredentials to every server Git connects to, or they specify it on the\ncommand line or in the config file, potentially exposing it to other\nusers or to anyone who accesses the repo, respectively.\n\nIt's also known that using http.extraheader for the Authorization header\nbreaks some uses of Git LFS, where some parts of the protocol can\ninclude their own Authorization header.  This is because that tool does\nas Git does and always adds the header, leaving two Authorization\nheaders which breaks authentication.  However, using a credential helper\nworks fine, since Git LFS only calls the credential helper if it doesn't\nhave credentials.\n\nIndicate clearly that http.extraheader should not be used for\ncredentials now that we have more robust credential helper support.\nRemove text that suggests it might have sensitive information in it,\nsince it should not.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\n Documentation/config/http.adoc | 8 ++++++++\n Documentation/git.adoc         | 7 +++----\n Documentation/gitfaq.adoc      | 3 ++-\n 3 files changed, 13 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/config/http.adoc b/Documentation/config/http.adoc\nindex 792a71b413..a8bd957585 100644\n--- a/Documentation/config/http.adoc\n+++ b/Documentation/config/http.adoc\n@@ -111,6 +111,14 @@ http.extraHeader::\n \tmore than one such entry exists, all of them are added as extra\n \theaders.  To allow overriding the settings inherited from the system\n \tconfig, an empty value will reset the extra headers to the empty list.\n++\n+Note that this option should not be to pass credentials and using it for that\n+purpose may cause security issues.  Using this option for the Authorization\n+header can also break some external tools.\n++\n+A credential helper is almost always more secure and does not impact external\n+tools negatively; note that modern credential helpers can implement any\n+reasonable method of authentication, including Bearer.\n \n http.cookieFile::\n \tThe pathname of a file containing previously stored cookie lines,\ndiff --git a/Documentation/git.adoc b/Documentation/git.adoc\nindex 1aa0608bae..d2f56e2f91 100644\n--- a/Documentation/git.adoc\n+++ b/Documentation/git.adoc\n@@ -104,10 +104,9 @@ where other processes might be able to read your command line\n (e.g. `/proc/self/environ`). That behavior is the default on\n Linux, but may not be on your system.\n +\n-Note that this might add security for variables such as\n-`http.extraHeader` where the sensitive information is part of\n-the value, but not e.g. `url.<base>.insteadOf` where the\n-sensitive information can be part of the key.\n+Note that this might add security for variables where the sensitive\n+information is part of the value, but not e.g. `url.<base>.insteadOf`\n+where the sensitive information can be part of the key.\n \n --exec-path[=<path>]::\n \tPath to wherever your core Git programs are installed.\ndiff --git a/Documentation/gitfaq.adoc b/Documentation/gitfaq.adoc\nindex b26e4e3a09..5bc33f7e26 100644\n--- a/Documentation/gitfaq.adoc\n+++ b/Documentation/gitfaq.adoc\n@@ -120,7 +120,8 @@ them for a certain period of time.\n You can also just enter your password when prompted.  While it is possible to\n place the password (which must be percent-encoded) in the URL, this is not\n particularly secure and can lead to accidental exposure of credentials, so it is\n-not recommended.\n+not recommended.  For similar reasons, we don't recommend using the\n+`http.extraheader` option for credentials, either.\n \n [[http-credentials-environment]]\n How do I read a password or token from an environment variable?::\n\n"},{"id":"559072","messageId":"xmqqzev1k6tj.fsf@gitster.g","threadId":"66910","inReplyTo":"20261121222723.23714-1-sandals@crustytoothpaste.net","subject":"Re: [PATCH] docs: indicate clearly that http.extraheader is not for creds","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-22T01:12:24Z","receivedAt":"2026-11-22T01:12:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> @@ -111,6 +111,14 @@ http.extraHeader::\n>  \tmore than one such entry exists, all of them are added as extra\n>  \theaders.  To allow overriding the settings inherited from the system\n>  \tconfig, an empty value will reset the extra headers to the empty list.\n> ++\n> +Note that this option should not be to pass credentials and using it for that\n\n\"used\" is missing in \"should not be used to pass ...\"?\n\n> +purpose may cause security issues.  Using this option for the Authorization\n\n"},{"id":"559121","messageId":"20261123011744.723147-1-sandals@crustytoothpaste.net","threadId":"66910","inReplyTo":"20261121222723.23714-1-sandals@crustytoothpaste.net","subject":"[PATCH v2] docs: indicate clearly that http.extraheader is not for creds","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-11-23T01:17:44Z","receivedAt":"2026-11-23T01:17:44Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"People frequently use http.extraheader for credentials, but it is not\nintended for that and is easy to misuse.  People using it for\ncredentials often do not use the URL-qualified option, exposing their\ncredentials to every server Git connects to, or they specify it on the\ncommand line or in the config file, potentially exposing it to other\nusers or to anyone who accesses the repo, respectively.\n\nIt's also known that using http.extraheader for the Authorization header\nbreaks some uses of Git LFS, where some parts of the protocol can\ninclude their own Authorization header.  This is because that tool does\nas Git does and always adds the header, leaving two Authorization\nheaders which breaks authentication.  However, using a credential helper\nworks fine, since Git LFS only calls the credential helper if it doesn't\nhave credentials.\n\nIndicate clearly that http.extraheader should not be used for\ncredentials now that we have more robust credential helper support.\nRemove text that suggests it might have sensitive information in it,\nsince it should not.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\nChanges since v1:\n* Include missing word.\n\n Documentation/config/http.adoc | 8 ++++++++\n Documentation/git.adoc         | 7 +++----\n Documentation/gitfaq.adoc      | 3 ++-\n 3 files changed, 13 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/config/http.adoc b/Documentation/config/http.adoc\nindex 792a71b413..d61180c909 100644\n--- a/Documentation/config/http.adoc\n+++ b/Documentation/config/http.adoc\n@@ -111,6 +111,14 @@ http.extraHeader::\n \tmore than one such entry exists, all of them are added as extra\n \theaders.  To allow overriding the settings inherited from the system\n \tconfig, an empty value will reset the extra headers to the empty list.\n++\n+Note that this option should not be used to pass credentials and using it for\n+that purpose may cause security issues.  Using this option for the\n+Authorization header can also break some external tools.\n++\n+A credential helper is almost always more secure and does not impact external\n+tools negatively; note that modern credential helpers can implement any\n+reasonable method of authentication, including Bearer.\n \n http.cookieFile::\n \tThe pathname of a file containing previously stored cookie lines,\ndiff --git a/Documentation/git.adoc b/Documentation/git.adoc\nindex 1aa0608bae..d2f56e2f91 100644\n--- a/Documentation/git.adoc\n+++ b/Documentation/git.adoc\n@@ -104,10 +104,9 @@ where other processes might be able to read your command line\n (e.g. `/proc/self/environ`). That behavior is the default on\n Linux, but may not be on your system.\n +\n-Note that this might add security for variables such as\n-`http.extraHeader` where the sensitive information is part of\n-the value, but not e.g. `url.<base>.insteadOf` where the\n-sensitive information can be part of the key.\n+Note that this might add security for variables where the sensitive\n+information is part of the value, but not e.g. `url.<base>.insteadOf`\n+where the sensitive information can be part of the key.\n \n --exec-path[=<path>]::\n \tPath to wherever your core Git programs are installed.\ndiff --git a/Documentation/gitfaq.adoc b/Documentation/gitfaq.adoc\nindex b26e4e3a09..5bc33f7e26 100644\n--- a/Documentation/gitfaq.adoc\n+++ b/Documentation/gitfaq.adoc\n@@ -120,7 +120,8 @@ them for a certain period of time.\n You can also just enter your password when prompted.  While it is possible to\n place the password (which must be percent-encoded) in the URL, this is not\n particularly secure and can lead to accidental exposure of credentials, so it is\n-not recommended.\n+not recommended.  For similar reasons, we don't recommend using the\n+`http.extraheader` option for credentials, either.\n \n [[http-credentials-environment]]\n How do I read a password or token from an environment variable?::\n\n"},{"id":"559160","messageId":"xmqq5wxnbjod.fsf@gitster.g","threadId":"66910","inReplyTo":"20261123011744.723147-1-sandals@crustytoothpaste.net","subject":"Re: [PATCH v2] docs: indicate clearly that http.extraheader is not for creds","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-23T16:24:02Z","receivedAt":"2026-11-23T16:24:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> People frequently use http.extraheader for credentials, but it is not\n\nUse camelCase `http.extraHeader` here, to match config/http.adoc and\nwhat git.adoc used to say before you removed its mention.\n\n> intended for that and is easy to misuse.  People using it for\n> credentials often do not use the URL-qualified option, exposing their\n> credentials to every server Git connects to, or they specify it on the\n> command line or in the config file, potentially exposing it to other\n> users or to anyone who accesses the repo, respectively.\n>\n> It's also known that using http.extraheader for the Authorization header\n\nDitto.\n\n> breaks some uses of Git LFS, where some parts of the protocol can\n> include their own Authorization header.  This is because that tool does\n> as Git does and always adds the header, leaving two Authorization\n> headers which breaks authentication.  However, using a credential helper\n> works fine, since Git LFS only calls the credential helper if it doesn't\n> have credentials.\n>\n> Indicate clearly that http.extraheader should not be used for\n\nDitto.\n\n> credentials now that we have more robust credential helper support.\n> Remove text that suggests it might have sensitive information in it,\n> since it should not.\n>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n> ...\n> diff --git a/Documentation/config/http.adoc b/Documentation/config/http.adoc\n> index 792a71b413..d61180c909 100644\n> --- a/Documentation/config/http.adoc\n> +++ b/Documentation/config/http.adoc\n> @@ -111,6 +111,14 @@ http.extraHeader::\n>  \tmore than one such entry exists, all of them are added as extra\n>  \theaders.  To allow overriding the settings inherited from the system\n>  \tconfig, an empty value will reset the extra headers to the empty list.\n> ++\n> +Note that this option should not be used to pass credentials and using it for\n> +that purpose may cause security issues.  Using this option for the\n> +Authorization header can also break some external tools.\n\nDo we want the word in monospaced backquotes `Authorization`?\n\n> ++\n> +A credential helper is almost always more secure and does not impact external\n> +tools negatively; note that modern credential helpers can implement any\n> +reasonable method of authentication, including Bearer.\n\nDo we want to linkgit:gitcredentials[7] somewhere, like the entry for\nhttp.proxy does?\n\n> diff --git a/Documentation/gitfaq.adoc b/Documentation/gitfaq.adoc\n> index b26e4e3a09..5bc33f7e26 100644\n> --- a/Documentation/gitfaq.adoc\n> +++ b/Documentation/gitfaq.adoc\n> @@ -120,7 +120,8 @@ them for a certain period of time.\n>  You can also just enter your password when prompted.  While it is possible to\n>  place the password (which must be percent-encoded) in the URL, this is not\n>  particularly secure and can lead to accidental exposure of credentials, so it is\n> -not recommended.\n> +not recommended.  For similar reasons, we don't recommend using the\n> +`http.extraheader` option for credentials, either.\n\nDitto on camelCase `http.extraHeader`.\n\n\n"},{"id":"559288","messageId":"20261124225656.1615821-1-sandals@crustytoothpaste.net","threadId":"66910","inReplyTo":"20261121222723.23714-1-sandals@crustytoothpaste.net","subject":"[PATCH v3] docs: indicate clearly that http.extraHeader is not for creds","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2026-11-24T22:56:56Z","receivedAt":"2026-11-24T22:56:56Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"People frequently use http.extraHeader for credentials, but it is not\nintended for that and is easy to misuse.  People using it for\ncredentials often do not use the URL-qualified option, exposing their\ncredentials to every server Git connects to, or they specify it on the\ncommand line or in the config file, potentially exposing it to other\nusers or to anyone who accesses the repo, respectively.\n\nIt's also known that using http.extraHeader for the Authorization header\nbreaks some uses of Git LFS, where some parts of the protocol can\ninclude their own Authorization header.  This is because that tool does\nas Git does and always adds the header, leaving two Authorization\nheaders which breaks authentication.  However, using a credential helper\nworks fine, since Git LFS only calls the credential helper if it doesn't\nhave credentials.\n\nIndicate clearly that http.extraHeader should not be used for\ncredentials now that we have more robust credential helper support.\nRemove text that suggests it might have sensitive information in it,\nsince it should not.\n\nSigned-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n---\nChanges since v2:\n* Use camelCase for `http.extraHeader`.\n* Use backticks for `Authorization`\n* Link to gitcredentials(7).\n\n Documentation/config/http.adoc | 9 +++++++++\n Documentation/git.adoc         | 7 +++----\n Documentation/gitfaq.adoc      | 3 ++-\n 3 files changed, 14 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/config/http.adoc b/Documentation/config/http.adoc\nindex 792a71b413..8f26eed6a4 100644\n--- a/Documentation/config/http.adoc\n+++ b/Documentation/config/http.adoc\n@@ -111,6 +111,15 @@ http.extraHeader::\n \tmore than one such entry exists, all of them are added as extra\n \theaders.  To allow overriding the settings inherited from the system\n \tconfig, an empty value will reset the extra headers to the empty list.\n++\n+Note that this option should not be used to pass credentials and using it for\n+that purpose may cause security issues.  Using this option for the\n+`Authorization` header can also break some external tools.\n++\n+A credential helper is almost always more secure and does not impact external\n+tools negatively; note that modern credential helpers can implement any\n+reasonable method of authentication, including Bearer. See\n+linkgit:gitcredentials[7] for more information.\n \n http.cookieFile::\n \tThe pathname of a file containing previously stored cookie lines,\ndiff --git a/Documentation/git.adoc b/Documentation/git.adoc\nindex 1aa0608bae..d2f56e2f91 100644\n--- a/Documentation/git.adoc\n+++ b/Documentation/git.adoc\n@@ -104,10 +104,9 @@ where other processes might be able to read your command line\n (e.g. `/proc/self/environ`). That behavior is the default on\n Linux, but may not be on your system.\n +\n-Note that this might add security for variables such as\n-`http.extraHeader` where the sensitive information is part of\n-the value, but not e.g. `url.<base>.insteadOf` where the\n-sensitive information can be part of the key.\n+Note that this might add security for variables where the sensitive\n+information is part of the value, but not e.g. `url.<base>.insteadOf`\n+where the sensitive information can be part of the key.\n \n --exec-path[=<path>]::\n \tPath to wherever your core Git programs are installed.\ndiff --git a/Documentation/gitfaq.adoc b/Documentation/gitfaq.adoc\nindex b26e4e3a09..dce40e659b 100644\n--- a/Documentation/gitfaq.adoc\n+++ b/Documentation/gitfaq.adoc\n@@ -120,7 +120,8 @@ them for a certain period of time.\n You can also just enter your password when prompted.  While it is possible to\n place the password (which must be percent-encoded) in the URL, this is not\n particularly secure and can lead to accidental exposure of credentials, so it is\n-not recommended.\n+not recommended.  For similar reasons, we don't recommend using the\n+`http.extraHeader` option for credentials, either.\n \n [[http-credentials-environment]]\n How do I read a password or token from an environment variable?::\n\n"}]}