News for hackers. Stuff that matters.
Re:Git security vulnerability announced by rst on Tuesday April 12, 2022 @09:21PM (#31010196)
Well, depending on exactly how much this blocks, this could get pretty awkward -- typing 'git log' in a repo owned by someone else can be awfully handy, even if file system permissions block changing it at all, and putting together a list of all places you might want to do this in advance could get pretty awkward. (Not running hooks, or allowing operations that would trigger them, from non-owned directories would preserve some of this usage, and still at least mitigate the dangerous cases somewhat.)

It's also not entirely clear to me what this does to site-wide shared remotes, though I suppose if they can be listed in system config, it's at least not a per-user hassle.

Re:Git security vulnerability announced by thelopa on Tuesday April 12, 2022 @09:42PM (#31010329)
I do this quite often, actually. I have my NixOS system config officially stored in /etc/nixos/ and owned by root. I have a clone that lives in my home directory for WIP changes, but builds always run out of the official copy. Sometimes it’s convenient to quickly run some read-only commands directly in the official copy
Re:Git security vulnerability announced by db48x on Tuesday April 12, 2022 @11:07PM (#31010792)
Ultimately you own that repository so just set it as safe in your config. Similarly if you are looking at a coworker’s repository then you can probably trust them. It’s only when you start sharing a computer with people that you don’t really know that you have a problem.
Re:Git security vulnerability announced by zeroimpl on Tuesday April 12, 2022 @09:45PM (#31010349)
Yes I’ve run “git status”, “git log” and “git diff” on other people’s repo’s plenty of times to help debug things, so it’d be sad to see this stop working. It seems some basic readonly operations should still be supported.
Re:Git security vulnerability announced by krick on Tuesday April 12, 2022 @11:44PM (#31010992)
It doesn't even have to be a repo. I do git diff --no-index all the time on arbitrary files, because it's simply configured the way I want, unlike some default diff or whatever command, that I don't even remember how to properly use.
Re:Git security vulnerability announced by leni536 on Wednesday April 13, 2022 @03:41AM (#31012115)
Maybe the pragmatic way from now on is to clone the repo, even if it's on the local machine.
Re:Git security vulnerability announced by rst on Wednesday April 13, 2022 @08:06PM (#31021882)
Cloning will miss any uncommitted local edits (which you might want to have run "git status" to detect)...
Re:Git security vulnerability announced by 3np on Tuesday April 12, 2022 @10:36PM (#31010625)
Yeah, it does seem to be very limiting. The previous behavior of allowing it can be configured by safe.directory[0].

In lack of CI I still tend to do builds in a container from a separate local user with read-only permissions. I wish they'd add an option to allow it when the user is in the owner group, which could be a decent compromise.

[0]: https://git-scm.com/docs/git-config/2.35.2#Documentation/git...

Re:Git security vulnerability announced by db48x on Tuesday April 12, 2022 @11:09PM (#31010796)
I kindof agree with you, but if you go to a university lab then you will likely find that all the students are all in the same groups. You don’t really want to blindly trust the group that way.
Re:Git security vulnerability announced by 3np on Tuesday April 12, 2022 @11:12PM (#31010819)
Oh yeah, in such an environment that would not make sense. I'm saying it should be a (local/global) config option, not enabled by default.

EDIT: Or maybe even more general, trustedOwnerUsers / trustedOwnerGroups

Re:Git security vulnerability announced by db48x on Tuesday April 12, 2022 @11:36PM (#31010946)
That’s a good idea; you should implement it and send them a patch.