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

[PATCH 0/2] disallow newlines in git:// URLs

From
Jeff King <peff@peff.net>
Date
Jan 7, 2021, 09:41 UTC
Message-ID
<X/bXV9dGFK2bxBV0@coredump.intra.peff.net>

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
Next: Jeff King
Message 1 of 3 in “disallow newlines in git:// URLs”
  1. 0/2 disallow newlines in git:// URLsJeff King, Jan 7, 2021
  2. 1/2 git_connect_git(): forbid newlines in host and pathJeff King, Jan 7, 2021
  3. 2/2 fsck: reject .gitmodules git:// urls with newlinesJeff King, Jan 7, 2021

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.