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

Re: [PATCH 2/4] receive-pack: implement advertising and receiving push options

From
Jeff King <peff@peff.net>
Date
Jul 7, 2016, 22:09 UTC
Message-ID
<20160707220941.GA27779@sigill.intra.peff.net>
In-Reply-To
<CAGZ79kbrZuDEN58sdBUQEbLeJbqVo5wNzXRjqAouRGqP=mw01A@mail.gmail.com>
On Thu, Jul 07, 2016 at 03:06:31PM -0700, Stefan Beller wrote:
Show 10 quoted lines
> > The problem is for hosting sites which serve repositories via git-daemon
> > from untrusted users who have real shell accounts (e.g., you set up
> > git-daemon to run as the "daemon" user serving repositories out of
> > people's home directories; you don't want users to escalate their shell
> > access into running arbitrary code as "daemon").
> 
> I think you would want to lock down the
> hosting site as much as possible and not put untrusted users home
> directories on there? So it is hard for me to imagine you'd go for such a setup
> in practice.

Sure, I think that's a good way to run a hosting site, too. But it doesn't mean people don't have other needs. kernel.org was run as I mentioned above for many years.

Another related case: you have a multi-user server where Alice might run "git fetch server:~bob/repo.git". Alice does not want to run arbitrary code based on what is in Bob's repo.git. Even if they are in the same company, it is a poor security practice.

Show 9 quoted lines
> > But I don't think that case applies here. That is about running
> > upload-pack on an untrusted repository, but your changes here are part
> > of receive-pack. In such a scenario, users should be pushing as
> > themselves via ssh. And if they are not (e.g., the admin set up
> > push-over-smart-http centrally), they are already screwed, as a
> > malicious user could just set up a pre-receive hook.
> 
> I hear that as: "The pre-receive hook itself can do much more
> damage than an oversized push option payload".

Exactly. Or more to the point: we promise nothing here except for upload-pack, so changes to receive-pack do not have to worry about this issue at all.

-Peff
Previous: Stefan BellerNext: Junio C Hamano
Message 7 of 31 in “[PATCHv3 0/4] Push options in C Git”
  1. Stefan BellerJul 7, 2016
  2. 2/4 receive-pack: implement advertising and receiving push optionsStefan Beller, Jul 7, 2016
  3. Junio C HamanoJul 7, 2016
  4. Stefan BellerJul 7, 2016
  5. Jeff KingJul 7, 2016
  6. Stefan BellerJul 7, 2016
  7. Jeff KingJul 7, 2016
  8. Junio C HamanoJul 7, 2016
  9. Jonathan NiederJul 8, 2016
  10. Junio C HamanoJul 8, 2016
  11. Stefan BellerJul 8, 2016
  12. Jeff KingJul 8, 2016
  13. Stefan BellerJul 8, 2016
  14. Jeff KingJul 8, 2016
  15. Stefan BellerJul 8, 2016
  16. Jeff KingJul 8, 2016
  17. Stefan BellerJul 8, 2016
  18. Jeff KingJul 8, 2016
  19. Stefan BellerJul 8, 2016
  20. 3/4 push: accept push optionsStefan Beller, Jul 7, 2016
  21. Junio C HamanoJul 7, 2016
  22. Stefan BellerJul 8, 2016
  23. Junio C HamanoJul 11, 2016
  24. 1/4 push options: {pre,post}-receive hook learns about push optionsStefan Beller, Jul 7, 2016
  25. Junio C HamanoJul 7, 2016
  26. Stefan BellerJul 7, 2016
  27. Junio C HamanoJul 7, 2016
  28. 4/4 add a test for push optionsStefan Beller, Jul 7, 2016
  29. Junio C HamanoJul 7, 2016
  30. Junio C HamanoJul 7, 2016
  31. Stefan BellerJul 7, 2016

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.