<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/credential.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-01-21T16:44:54Z</updated>
<entry>
<title>Merge branch 'ps/the-repository'</title>
<updated>2025-01-21T16:44:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-01-21T16:44:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b39a128c814a2362d0533c7df0ab7a2fef6fa4b'/>
<id>urn:sha1:7b39a128c814a2362d0533c7df0ab7a2fef6fa4b</id>
<content type='text'>
More code paths have a repository passed through the callchain,
instead of assuming the primary the_repository object.

* ps/the-repository:
  match-trees: stop using `the_repository`
  graph: stop using `the_repository`
  add-interactive: stop using `the_repository`
  tmp-objdir: stop using `the_repository`
  resolve-undo: stop using `the_repository`
  credential: stop using `the_repository`
  mailinfo: stop using `the_repository`
  diagnose: stop using `the_repository`
  server-info: stop using `the_repository`
  send-pack: stop using `the_repository`
  serve: stop using `the_repository`
  trace: stop using `the_repository`
  pager: stop using `the_repository`
  progress: stop using `the_repository`
</content>
</entry>
<entry>
<title>Sync with Git 2.47.2</title>
<updated>2025-01-13T20:55:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-01-13T20:55:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65faad6d841c29d4545e9cf3676d75f4e6e4872c'/>
<id>urn:sha1:65faad6d841c29d4545e9cf3676d75f4e6e4872c</id>
<content type='text'>
Git 2.47.2

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE4fA2sf7nIh/HeOzvsLXohpav5ssFAmdkT1sACgkQsLXohpav
# 5svdhRAAq0WoZIg+33vYNNVSTm3Ux9RJslmXs3lQuhuUJ61hK/28drSLU29GH7x7
# 3nmmjp1cegnXRVLBAfoYDdzPprNNrQFQEHQEzgG/GDZw0OXn+WTZuNyrrUYoa+sd
# QSLlElRj2qrpHIMOsMIBKBSNB+qjJHOMGdxcBAS768TfnQpGIpc1KJa24TxsVBzC
# ScP4uvrFfPyQrqFUgiUhCeqLnO/6T5i/QAn/8cS5a1+zor5ZHSlw28TZTOxN2odo
# Rulp/FtehiDEzmRowgD3M4fImAPY6Ib6VORCYASqpJFFla30tu2bQqEi6raOMTec
# hg5Ibkmj6fHFONaYvoTMRkYHmtUnNgIPU/CYPwswNk8w1+PPQfJ+TYjBXOQgdTLW
# F0azHBHh7NRmEHVydiF9CqjgNVRzjO4IEZfGqXNFPPMvR6UUzDaIkrpYbwXBFMin
# GNPV3QISeXj9ROjJoCv0nclXETwWemykjZlD6b5krXn5TaJlFb+69qJvXrCLq5WY
# EoevSqKkB9HVK9si7P8Sh1cPGOr3kfiFPmMNKFVI8l0+iDFgBywOomWNS/JEzqu1
# nN142DKdL1W/rkeMUhbX2h11CZNvHKIOy3iaA4MTOing8/eMzyUUQ73Ck7odYs4f
# rZ0tTXKJhxojPvBpTxYe9SxM0bDLREiOv0zX76+sIuhbAQCmk0o=
# =MNNf
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 19 Dec 2024 08:52:43 AM PST
# gpg:                using RSA key E1F036B1FEE7221FC778ECEFB0B5E88696AFE6CB
# gpg: Good signature from "Junio C Hamano &lt;gitster@pobox.com&gt;" [ultimate]
# gpg:                 aka "Junio C Hamano &lt;junio@pobox.com&gt;" [ultimate]
# gpg:                 aka "Junio C Hamano &lt;jch@google.com&gt;" [ultimate]

* tag 'v2.47.2':
  Git 2.47.2
  Git 2.46.3
  Git 2.45.3
  Git 2.44.3
  Git 2.43.6
  Git 2.42.4
  Git 2.41.3
  Git 2.40.4
  credential: disallow Carriage Returns in the protocol by default
  credential: sanitize the user prompt
  credential_format(): also encode &lt;host&gt;[:&lt;port&gt;]
  t7300: work around platform-specific behaviour with long paths on MinGW
  compat/regex: fix argument order to calloc(3)
  mingw: drop bogus (and unneeded) declaration of `_pgmptr`
  ci: remove 'Upload failed tests' directories' step from linux32 jobs
</content>
</entry>
<entry>
<title>credential: stop using `the_repository`</title>
<updated>2024-12-18T18:44:31Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-17T06:43:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6c27d22276b754e2214242de7a200b372aa611f6'/>
<id>urn:sha1:6c27d22276b754e2214242de7a200b372aa611f6</id>
<content type='text'>
Stop using `the_repository` in the "credential" subsystem by passing in
a repository when filling, approving or rejecting credentials.

Adjust callers accordingly by using `the_repository`. While there may be
some callers that have a repository available in their context, this
trivial conversion allows for easier verification and bubbles up the use
of `the_repository` by one level.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>global: mark code units that generate warnings with `-Wsign-compare`</title>
<updated>2024-12-06T11:20:02Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-06T10:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41f43b8243f42b9df2e98be8460646d4c0100ad3'/>
<id>urn:sha1:41f43b8243f42b9df2e98be8460646d4c0100ad3</id>
<content type='text'>
Mark code units that generate warnings with `-Wsign-compare`. This
allows for a structured approach to get rid of all such warnings over
time in a way that can be easily measured.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Sync with 2.46.3</title>
<updated>2024-11-26T21:15:02Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-10-30T00:12:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3fad508c3f5d51c017c9ab5760ef492c11668313'/>
<id>urn:sha1:3fad508c3f5d51c017c9ab5760ef492c11668313</id>
<content type='text'>
* maint-2.46:
  Git 2.46.3
  Git 2.45.3
  Git 2.44.3
  Git 2.43.6
  Git 2.42.4
  Git 2.41.3
  Git 2.40.4
  credential: disallow Carriage Returns in the protocol by default
  credential: sanitize the user prompt
  credential_format(): also encode &lt;host&gt;[:&lt;port&gt;]
  t7300: work around platform-specific behaviour with long paths on MinGW
  compat/regex: fix argument order to calloc(3)
  mingw: drop bogus (and unneeded) declaration of `_pgmptr`
  ci: remove 'Upload failed tests' directories' step from linux32 jobs
</content>
</entry>
<entry>
<title>Sync with 2.45.3</title>
<updated>2024-11-26T21:15:01Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-10-30T00:03:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=67809f7c4c654e0f7c4fefff3b46451e217a0294'/>
<id>urn:sha1:67809f7c4c654e0f7c4fefff3b46451e217a0294</id>
<content type='text'>
* maint-2.45:
  Git 2.45.3
  Git 2.44.3
  Git 2.43.6
  Git 2.42.4
  Git 2.41.3
  Git 2.40.4
  credential: disallow Carriage Returns in the protocol by default
  credential: sanitize the user prompt
  credential_format(): also encode &lt;host&gt;[:&lt;port&gt;]
  t7300: work around platform-specific behaviour with long paths on MinGW
  compat/regex: fix argument order to calloc(3)
  mingw: drop bogus (and unneeded) declaration of `_pgmptr`
  ci: remove 'Upload failed tests' directories' step from linux32 jobs
</content>
</entry>
<entry>
<title>Sync with 2.42.4</title>
<updated>2024-11-26T21:14:59Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-10-29T23:52:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c39c2d29e62d5bd13f390ca20f6e756aced681b1'/>
<id>urn:sha1:c39c2d29e62d5bd13f390ca20f6e756aced681b1</id>
<content type='text'>
* maint-2.42:
  Git 2.42.4
  Git 2.41.3
  Git 2.40.4
  credential: disallow Carriage Returns in the protocol by default
  credential: sanitize the user prompt
  credential_format(): also encode &lt;host&gt;[:&lt;port&gt;]
  t7300: work around platform-specific behaviour with long paths on MinGW
  compat/regex: fix argument order to calloc(3)
  mingw: drop bogus (and unneeded) declaration of `_pgmptr`
  ci: remove 'Upload failed tests' directories' step from linux32 jobs
</content>
</entry>
<entry>
<title>Sync with 2.41.3</title>
<updated>2024-11-26T21:14:58Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-10-29T23:39:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=102e0e6daa920a811890a612578a7723335b1f77'/>
<id>urn:sha1:102e0e6daa920a811890a612578a7723335b1f77</id>
<content type='text'>
* maint-2.41:
  Git 2.41.3
  Git 2.40.4
  credential: disallow Carriage Returns in the protocol by default
  credential: sanitize the user prompt
  credential_format(): also encode &lt;host&gt;[:&lt;port&gt;]
  t7300: work around platform-specific behaviour with long paths on MinGW
  compat/regex: fix argument order to calloc(3)
  mingw: drop bogus (and unneeded) declaration of `_pgmptr`
  ci: remove 'Upload failed tests' directories' step from linux32 jobs
</content>
</entry>
<entry>
<title>Sync with 2.40.4</title>
<updated>2024-11-26T21:14:57Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-10-29T23:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=676cddebf94fab8defe704b2f58c5b59912bb40c'/>
<id>urn:sha1:676cddebf94fab8defe704b2f58c5b59912bb40c</id>
<content type='text'>
* maint-2.40:
  Git 2.40.4
  credential: disallow Carriage Returns in the protocol by default
  credential: sanitize the user prompt
  credential_format(): also encode &lt;host&gt;[:&lt;port&gt;]
  t7300: work around platform-specific behaviour with long paths on MinGW
  compat/regex: fix argument order to calloc(3)
  mingw: drop bogus (and unneeded) declaration of `_pgmptr`
  ci: remove 'Upload failed tests' directories' step from linux32 jobs
</content>
</entry>
<entry>
<title>credential: disallow Carriage Returns in the protocol by default</title>
<updated>2024-11-26T19:24:04Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2024-11-04T13:48:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b01b9b81d36759cdcd07305e78765199e1bc2060'/>
<id>urn:sha1:b01b9b81d36759cdcd07305e78765199e1bc2060</id>
<content type='text'>
While Git has documented that the credential protocol is line-based,
with newlines as terminators, the exact shape of a newline has not been
documented.

From Git's perspective, which is firmly rooted in the Linux ecosystem,
it is clear that "a newline" means a Line Feed character.

However, even Git's credential protocol respects Windows line endings
(a Carriage Return character followed by a Line Feed character, "CR/LF")
by virtue of using `strbuf_getline()`.

There is a third category of line endings that has been used originally
by MacOS, and that is respected by the default line readers of .NET and
node.js: bare Carriage Returns.

Git cannot handle those, and what is worse: Git's remedy against
CVE-2020-5260 does not catch when credential helpers are used that
interpret bare Carriage Returns as newlines.

Git Credential Manager addressed this as CVE-2024-50338, but other
credential helpers may still be vulnerable. So let's not only disallow
Line Feed characters as part of the values in the credential protocol,
but also disallow Carriage Return characters.

In the unlikely event that a credential helper relies on Carriage
Returns in the protocol, introduce an escape hatch via the
`credential.protectProtocol` config setting.

This addresses CVE-2024-52006.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
</content>
</entry>
</feed>
