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

Re: Shared repositories no longer securable against privilege escalation

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 17, 2017, 15:26 UTC
Message-ID
<xmqqo9wz9b68.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<195b30d7-9ea2-7a9b-79ca-41b7bb890a30@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
> (I can't resist pointing out that the *real* bug is storing special
> references like `HEAD` in the top level of $GIT_DIR, but that can't be
> changed now.)

If you call that "pointing out", I can't resist pointing out that you are utterly *wrong* ;-)

For one thing, HEAD.lock being the only reported case does not mean "special refs" is the only thing, and more importantly, it will stay to be the only thing, that would want to write directly underneath $GIT_DIR directory. We may want to add a feature to store push certificates whenever a signed push is made, and we are free to decide that directly underneath $GIT_DIR is the place to do so.

Also, with your same logic, you could also say that the real bug is not in the refs subsystem but is in the lockfile subsystem. If it did not use $GIT_DIR/$thing.lock when locking $GIT_DIR/$thing, and instead it used $GIT_DIR/lock/$thing to do so, you wouldn't have needed to be able to create $GIT_DIR/HEAD.lock.

I _think_ the real bug is that somehow a user got a wrong impression that directly underneath $GIT_DIR/ is somehow different from its subdirectory and it is OK to make the directory unwritable. I do not think we never intended to give such a promise, but there may be a documentation bug that gives the wrong impression, which we may have to fix.

We do try to make sure that in a read-only repository $GIT_DIR/ and everything underneath can be read-only (and if that is not the case, you found a bug), but even in that case, we do not special case $GIT_DIR/ itself and its subdirectories.

Previous: Michael HaggertyNext: Joe Rayhawk
Message 3 of 9 in “Shared repositories no longer securable against privilege escalation”
  1. Joe RayhawkMar 17, 2017
  2. Michael HaggertyMar 17, 2017
  3. Junio C HamanoMar 17, 2017
  4. Joe RayhawkMar 17, 2017
  5. Junio C HamanoMar 17, 2017
  6. Joe RayhawkMar 17, 2017
  7. Jakub NarębskiMar 18, 2017
  8. Junio C HamanoMar 17, 2017
  9. Ævar Arnfjörð BjarmasonMar 18, 2017

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.