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

Re: Trust issues with hooks and config files

From
JBJulian Brost <julian@0x4a42.net>
Date
Mar 9, 2014, 17:27 UTC
Message-ID
<531CA468.3060604@0x4a42.net>
In-Reply-To
<20140307210403.GA6790@sigill.intra.peff.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 07.03.2014 22:04, Jeff King wrote:
> Yes, this is a well-known issue. The only safe operation on a
> repository for which somebody else controls hooks and config is to
> fetch from it (upload-pack on the remote repository does not
> respect any dangerous config or hooks).

I'm a little bit surprised that you and some other people I asked see this as such a low-priority problem as this makes social engineering attacks on multi-user systems, like they are common at universities, really easy (this is also how I noticed the problem).

Show 15 quoted lines
> It has been discussed, but nobody has produced patches. I think
> that nobody is really interested in doing so because:
> 
> 1. It introduces complications into previously-working setups
> (e.g., a daemon running as "nobody" serving repos owned by a "git"
> user needs to mark "git" as trusted).
> 
> 2. In most cases, cross-server boundaries provide sufficient 
> insulation (e.g., I might not push to an evil person's repo, but
> rather to a shared repo whose hooks and config are controlled by
> root on the remote server).
> 
> If you want to work on it, I think it's an interesting area. But
> any development would need to think about the transition plan for
> existing sites that will be broken.

I can understand the problem with backward compatibility but in my opinion the default behavior should definitely be to ignore untrusted config files and hooks as it would otherwise only protect users that are already aware of the issue anyways and manually enable this option.

Are there any plans for some major release in the future that would allow introducing backward incompatible changes?

I would definitely spend some time working on a patch but so far I have no idea of git's internals and never looked at the source before.

> At the very least, the current trust model could stand to be
> documented much better (I do not think the rule of "fetching is
> safe, everything else is not" is mentioned anywhere explicitly).
Good point but not enough in my opinion as I haven't read every git
manpage before running it for the first time.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJTHKRfAAoJECLcYT6QIdBtGdkQALD24YhS2aHBzi/c6a/1+eOC xERUshDJvU/3picpTqqwFlqHB6X53vo7uXcCmJU8oaMsGLeLrTyrX77YOzrhlkuK kERkXGPgyoW1G4enATSURDbjW6kp7SG0lRvGTPNySqDt9FiZYTDP7CGsQRDDl8cL al50BoNFsx9K/kiPgbDJsenDi/MAclAYlHbHJnEB6aBo06G89zwC2tECFtXewnAD EbCKPI4tFrUZW/rWxHAEDVs+cI038nMzSNMi7I+HAMG48s+iMfFF69pkdOQjhIsc 3irisLQcKPVNRjSK/dGEKbqkAy9wziNza69tl0EgQn6ewju5NZ4xbAkWQG9LEWfZ Ux1safkumQsAKiYfn87t5YDXZ3vDYKbChKQv/UlicobVRm0YbhitY2AQAzu+wx1V mXmG6D91IxfR4B0+AA+3/E8huSD4JJ2laIUwIoYV+y4+ZAlxnT4cNdYiYAH4oEme wZ9R0wsxVfUm+uFdSBqsgEpv7Bp9PRcREuVXXz0GQH0wQ8zdwOeeNvA3v6ZtodRZ 0q7WOVJpd/3j4fQoWUXFAOZxDIZVorM0dQQvbhXiwOE9UY5Gwpq22lGKHM1t+8EO lOUCQBXjscfPgyLifdSbnaf11RGgVLERQlpz6hpEGht1J3AqF6tTZPjto+iVV97v nObYVtMXsAtrKbka2FF+ =ps1M -----END PGP SIGNATURE-----

Previous: Jeff KingNext: Junio C Hamano
Message 3 of 5 in “Trust issues with hooks and config files”
  1. Julian BrostMar 6, 2014
  2. Jeff KingMar 7, 2014
  3. Julian BrostMar 9, 2014
  4. Junio C HamanoMar 10, 2014
  5. Sitaram ChamartyMar 16, 2014

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.