git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/2] disallow newlines in git:// URLs
@ 2021-01-07  9:41 Jeff King
  2021-01-07  9:43 ` [PATCH 1/2] git_connect_git(): forbid newlines in host and path Jeff King
  2021-01-07  9:44 ` [PATCH 2/2] fsck: reject .gitmodules git:// urls with newlines Jeff King
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff King @ 2021-01-07  9:41 UTC (permalink / raw)
  To: git; +Cc: Harold Kim

This addresses an issue brought up by Harold Kim on the security list.
In general, Git handles repo paths with newlines just fine, and this
even works over the git:// protocol. However, because of the sparseness
of that protocol, it's easy to craft a malicious URL that makes a valid
request for other protocols, like http (and submodules make it easy-ish
to convince somebody to clone your crafted URL).

Since it's unlikely that anybody is relying on having a newline in their
git:// repo in the first place, it's worth outlawing them to make it
less likely for a Git client to be used as a protocol redirect.

  [1/2]: git_connect_git(): forbid newlines in host and path
  [2/2]: fsck: reject .gitmodules git:// urls with newlines

 connect.c                     |  2 ++
 fsck.c                        |  2 +-
 t/t5570-git-daemon.sh         |  5 +++++
 t/t7416-submodule-dash-url.sh | 15 +++++++++++++++
 4 files changed, 23 insertions(+), 1 deletion(-)

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-07  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07  9:41 [PATCH 0/2] disallow newlines in git:// URLs Jeff King
2021-01-07  9:43 ` [PATCH 1/2] git_connect_git(): forbid newlines in host and path Jeff King
2021-01-07  9:44 ` [PATCH 2/2] fsck: reject .gitmodules git:// urls with newlines Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).