Article View: linux.kernel.git
Article #3600[PATCH v2] docs: indicate clearly that http.extraheader is not for creds
From: "brian m. carlson"
Date: Mon, 23 Nov 2026 01:17
Date: Mon, 23 Nov 2026 01:17
82 lines
12518 bytes
12518 bytes
People frequently use http.extraheader for credentials, but it is not 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 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 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> --- Changes since v1: * Include missing word. Documentation/config/http.adoc | 8 ++++++++ Documentation/git.adoc | 7 +++---- Documentation/gitfaq.adoc | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) 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. ++ +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. http.cookieFile:: The pathname of a file containing previously stored cookie lines, diff --git a/Documentation/git.adoc b/Documentation/git.adoc index 1aa0608bae..d2f56e2f91 100644 --- a/Documentation/git.adoc +++ b/Documentation/git.adoc @@ -104,10 +104,9 @@ where other processes might be able to read your command line (e.g. `/proc/self/environ`). That behavior is the default on Linux, but may not be on your system. + -Note that this might add security for variables such as -`http.extraHeader` where the sensitive information is part of -the value, but not e.g. `url.<base>.insteadOf` where the -sensitive information can be part of the key. +Note that this might add security for variables where the sensitive +information is part of the value, but not e.g. `url.<base>.insteadOf` +where the sensitive information can be part of the key. --exec-path[=<path>]:: Path to wherever your core Git programs are installed. 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. [[http-credentials-environment]] How do I read a password or token from an environment variable?::
Technical Details
Message-ID:
<20261123011744.723147-1-sandals@crustytoothpaste.net>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.endofthelinebbs.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-76109-linux-kernel-git=dewy.ruReferences:
<20261121222723.23714-1-sandals@crustytoothpaste.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.endofthelinebbs.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-76109-linux-kernel-git=dewy.ru
From: sandals@crustytoothpaste.net ("brian m. carlson")
Newsgroups: linux.kernel.git
Subject: [PATCH v2] docs: indicate clearly that http.extraheader is not for creds
Date: Mon, 23 Nov 2026 01:17:44 +0000
Organization: Usenet Network
Message-ID: <20261123011744.723147-1-sandals@crustytoothpaste.net>
References: <20261121222723.23714-1-sandals@crustytoothpaste.net>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="3761964"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:kolqmBPhGBpxWT60a8xENDhQGe8= sha256:jRcGqF1rt9ViyJgEWEe9HY61iX74OhCT0UFGRxNY8QI=
sha1:KYcuTzxgG9XfdoESPG0I9Ml2bvM= sha256:Le/uz7yx0zE9vvAvoCPjwyXOA2cZoxMAu4Veef4Hn2Y=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 3FF88125D89; Mon, 23 Nov 2026 04:18:10 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (3072-bit key)
header.d=crustytoothpaste.net
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id F-c36JAZ9X9m;
Mon, 23 Nov 2026 04:18:02 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=git+bounces-76109-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=crustytoothpaste.net
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id CC476125D83; Mon, 23 Nov 2026 04:17:52 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id 38CFB601EDA; Mon, 23 Nov 2026 01:17:52 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795396671;
b=5V6vTKJ6S3Goy7tWA/sH74K20BxzsehKfg7Ve86QU4FikIGJB2WRderWdowIlhUhqeXs
xumzvSbGbBS/TJCXmFo+N/tnQXMsCXrP6pr3/gr5B5kCiseQfjTGTJ/pINGr6jLlPn8+S
wtw+3iWy2aCQwcV7ZzruLskWoDYrqLopuUiYsVSFOmIzvsSEqWywzpG8XM0/wh1TbgK3z
q0AxcedZJFMLuGXG3g8R6pA9QpOpXNPct9LvjNqeL6qL+NShxwHBdbj4aPeRrJNbfxOSz
8hWhdoWIkdhFN4GP45jl050CB8fxt7S9wAvr94eFUcWmrPs0pou9PIeKBIrJACHUkew==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795396671;
h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To:
Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=RcdS02zp3/YRjCF6c8Yp3K43fQ5EDp/T3pW5in9iuWQ=;
b=AI1EAZPxBNx7FESmq0NOiaV5nq90CNBOY8xmCR3mQcAyXQiZphFY1I+F4H3ppVtzX21V
TQ15aG2b2aTnureTeMk0Px7JXSDaI9YbAv/CsVCxIR50KeDPuzkfRKRK4zM80HCEjjOuO
XfY/ZdXuwfo7m+XkfRiyYdJUq3xs4SdYHfY+egr6pa87PY9i0YoXF0aERWpETDLeRWn4B
QgT10gypsxGQL8ZEgWfHCL3HcmNOV/yIZxRQTrfhgr/Z8Fj1zXUQHkW/sv+WyM8O6YDj4
oYfSjfBVBkr/k041tuPHlsSeWiSvgCLLftsoR9CBIJKUFPktWFcsS7BWTBnE46mCIbg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=A5Gej2NZ;
dmarc=pass header.from=crustytoothpaste.net;
spf=pass smtp.mailfrom=crustytoothpaste.net;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id E2822606A330;
Mon, 23 Nov 2026 01:17:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (3072-bit key) header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=A5Gej2NZ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=172.105.7.114
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795396670;
b=y4MNXaK3AXGvQGRaDdlJ2+uxrLSxBieGIwu37Gdoh/sFK3oCJ/O8EK5APpMD+PSuPurV
2Y7TEmKiqwUfTY+os9KeE4L9N8jOilBAByz3dBtgwUD5uH/1NAOzVtH1je7GXi9b0su+6
fjAGp3eYX6XRvzLXGvpoQlAIbW8Y3+y9tdBbDhxjw+hB/bPh4y7msK0s3pzKu75bXNcUf
sTHBX+y/MCGxm9Rt/NxMzafkLLBGaY6uJCBf+EimB2rbJJclLrhZsgrEZ9uOdxtysR+u6
WvE9MZbtQw+R1B3s37OznxRmUkE/Bg8ozFe4We+B351EPhJ2Zm/1Dmh6smgfdEId/VA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795396670;
h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date:
Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=RcdS02zp3/YRjCF6c8Yp3K43fQ5EDp/T3pW5in9iuWQ=;
b=DHmiAEXEOcLhk4aHy5EPpPpq6nXex9Gh7xCKKsFI82vUQZB+u7MNWn4Er1XJ6AzTrbjo
Z+Evy3jWN2Cxo0R2WRGpCEJ/0X6YkOKEDEQouWVccp2dfIiD7TUXHLr0SEvv/7NgykkD+
oPhgBpW0e9s/uwYdKfR2iw3OVtB0gGlPbxYxHxedVxEFUuw48cCxTGJ223As6iExQP2pc
z4tZLzEUErm+9zVC9NbaOSQHGWxLijnTCnkggtaMHfln93NiGJi+Pqv8ZzfN3owH/5Vok
UKKSmySwvKLspbvzO98q9eN2CsV/h3hfqW0hmcKko1VCTntavqwglOFfvDq7tqCHd7g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=crustytoothpaste.net;
spf=pass smtp.mailfrom=crustytoothpaste.net;
dkim=pass header.d=crustytoothpaste.net header.i=@crustytoothpaste.net header.a=rsa-sha256 header.s=default header.b=A5Gej2NZ;
arc=none smtp.remote-ip=172.105.7.114
X-Received: from complex.crustytoothpaste.net (complex.crustytoothpaste.net [172.105.7.114])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC0CB606A31E
for <git@vger.kernel.org>; Mon, 23 Nov 2026 01:17:49 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AC0CB606A31E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=crustytoothpaste.net
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=crustytoothpaste.net
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net;
s=default; t=1795396668;
bh=SCfkUFrapIIMK/uRYgtLi5GZ3GpBCnlBJDzqLVxrqK0=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To:
Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc:
In-Reply-To:References:Content-Type:Content-Disposition;
b=A5Gej2NZ2+KnMpHa4TfZ4LWYdxbsMO4mFMqWK4NRfE2m9dMI8mzNZDncqi8SqtelJ
5a+DMyRuB+NzJY+t8Sb0kpnNk3INiScQgyiAjkPqh1Z2QMqx2682/ahF+YV5Rt6/+W
Xu+2xn67e7DPP90qe7B4dFfGwgSoKAFG4ir3lyWQeL9zachTWI+1XrEGdLMfSsxvgF
jyIYKflzVD5DMLl7LGNIf1U2OqYsD2P1vNknBc8wRceHmxEGhGD/jse1DaIWVXuby2
02ckCged1SGr+x96geW4svlQflv1GqN6SpUN7JbvxbJykpFHmP0mKOFjlJm/HiWZQ6
UE0prXqB2A+1OaJv5xzNk8nSbuNRyaomtagF+BaKaQCGIHuH8gwmZlameQzIILSnxQ
9hkh9oy3osieQNneE+nrEMFrwsGvx3ym6a7SvVZqkiFCCTDRsBmrT66dP/jbzvSkQ/
H7kZy8py15NGUFFqKWw2AwRoGyg5389g8qbjwm5Loq/b8BJ+rVX
X-Received: from fruit.crustytoothpaste.net (unknown [IPv6:2607:f2c0:f00f:f901:d948:43c9:4db6:a02a])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by complex.crustytoothpaste.net (Postfix) with ESMTPSA id BC866200AA;
Mon, 23 Nov 2026 01:17:48 +0000 (UTC)
X-Cc: Junio C Hamano <gitster@pobox.com>
X-Mailer: git-send-email 2.53.0.697.g625c4fb2daa
X-In-Reply-To: <20261121222723.23714-1-sandals@crustytoothpaste.net>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list