by delsarto on 4/13/22, 12:02 AM with 273 comments
by dang on 4/13/22, 4:46 PM
by tommiegannert on 4/13/22, 6:52 AM
How do I run something as SYSTEM? I thought I always ran as "me" or Administrator. Is this only likely to happen for deployment automation tools?
> Avoid running the uninstaller until after upgrading
Don't leave us with this cliff-hanger... Does the upgrade installer run the uninstaller first? (The original report doesn't have this bullet point.)
by ntauthority on 4/13/22, 6:25 AM
by eminence32 on 4/13/22, 1:27 AM
I'm curious about this -- what's the attack vector here?
by krick on 4/13/22, 3:23 AM
But ok, let's not take it as an excuse. How about fixing git, then? I mean, actually fixing: making it possible to disable hooks & core.fsmonitor & whatever else they fucked up? No, right, let's just disable git instead.
And if I'm reading this correctly, I'm not even allowed to say "I don't care" — I must explicitly mark every shared directory as trusted (I mean, safe.directory = '/' won't work unless / is actually a git directory, right?).
I guess I just shouldn't update git until this "fix" is fixed. Or until git is forked.
by jra_samba on 4/13/22, 3:02 AM
Symlinks, the poisonous gift that keeps on giving.
by rst on 4/13/22, 1:21 AM
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.
by rvwaveren on 4/13/22, 6:37 AM
by mlindner on 4/13/22, 3:35 AM
by kazinator on 4/14/22, 6:41 AM
Or else, if you're not root, you're in messed up system. Whoever is root should go read some 40-year-old book on Unix about how it's supposed to be laid out.
This is not a genuine security vulnerability; though of course, it's good to fix it.
Here is how I would fix it. Forget about permissions and ownership entirely. There is a weaker, more powerful condition we can check. Ready?
Git should terminate if it is executed from a subdirectory of a git repo that contains no tracked files according to the first .git/ directory that it finds while ascending the file system.
If you're in a directory that contains no files that are tracked by the closest .git/ that can be found by walking up the stairs, then that directory has no relationship to that repo. Git should diagnose that and bail out. (It could allow files in that directory to be added to the index, but only with -f option to force it.)
If git finds a .git/ dir, and that repo's index shows that at least one item in, or below, your working directory is in that repo's index, it should go ahead and work with it, regardless of ownership.
by saagarjha on 4/13/22, 3:07 AM
by dcow on 4/13/22, 12:31 PM
by dotancohen on 4/13/22, 6:22 AM
$ grep GIT_CEILING_DIRECTORIES ~/.bashrc
export GIT_CEILING_DIRECTORIES=$HOME:/var/www
But malicious Git repos could still affect your user profile. You can harden that by putting all git repos in a sandbox, e.g.: export GIT_CEILING_DIRECTORIES=$HOME/sandbox
by silverwind on 4/14/22, 9:12 AM
It seems they forgot to provide an exception for the root user or a way to disable this "feature" on a global level, instead of per-directory.
by kgeist on 4/13/22, 5:33 AM
If a malicious actor has access to the filesystem, isn't it a bigger problem? I remember Raymond Chen recounted in his blog that Microsoft usually dismisses vulnerability reports that start with "to use the exploit, you must have access to the machine". As he likes to say, "the gates are already open". If you already have access to the machine and can create files outside of your home directory, what stops you from causing even greater havoc?
by nodesocket on 4/13/22, 6:15 AM
ubuntu@vpn1:$ git --version
git version 2.25.1
ubuntu@vpn1:$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
by hda2 on 4/13/22, 3:20 AM
I think this is a big mistake. Build environments use separate users for security purposes. It's insane to decrease security for everyone by requiring a single user to do everything because some of your users want to have fancy terminal prompts.
At the very least, let users configure this at a per-user level.
by Matheus28 on 4/13/22, 2:30 AM
by legalcorrection on 4/13/22, 9:12 PM
by zmmmmm on 4/13/22, 5:00 AM
It's fascinating to me that we have people out there just casually making these kind of decisions with enormous cost implications with barely any thought to the downstream implications. Then meanwhile, we need approval in our org to claim a $30 taxi voucher as an expense.
by jwilk on 4/13/22, 8:41 AM
by ab-dm on 4/13/22, 2:57 AM
by Shalomboy on 4/13/22, 4:57 PM
by sharken on 4/13/22, 9:15 AM
Microsoft's own package manager Winget only has v2.34.1 right now.
Chocolatey https://community.chocolatey.org/packages/git#versionhistory
by usrbinbash on 4/13/22, 2:13 PM
by bin_bash on 4/13/22, 2:17 AM
by yuliyp on 4/13/22, 2:23 AM
by dataflow on 4/13/22, 2:58 AM
by Dave3of5 on 4/13/22, 8:37 AM
by alkonaut on 4/13/22, 5:52 AM
by bloaf on 4/13/22, 2:50 AM
Jr Engineer: "Hey, I know we've always managed our little dotnet application via email and shared-network-drive, but I've been reading about a thing called "git" that we should probably use."
Sr Engineer: "Change is scary and bad, also we are not a software company. We're not going to learn some newfangled whatsit. Just email me the .vba files when you want me to review the changes with the one copy of visual studio 2008 that our team has access to."
Jr Engineer: "C'mon, give it a chance! We can leave everything the way its always been, but have better tracking of changes. Remember that time Bruno hard coded the tool to point to the C: drive? Git would let us just undo that, instead of having to search our emails for the last-most-recent version."
Sr Engineer: "Ok fine, I've got 10 minutes, show me."
Jr Engineer: "Ahh! Well I just got it installed, so let me go to the network drive... and then I think I have to git init our project folder... huh? Let me just... Maybe if I..."
Sr Engineer: "Times up! Looks like this "git" thing isn't compatible with our setup after all. Those modern dev types never make anything that works in a real enterprise environment."
by fargle on 4/13/22, 2:13 PM
CVE-12345: insecure use of consumer grade operating system in multi-user role when expecting any form of real isolation
CVE-12346: faulty system administration techniques, including running anything as SYSTEM, can cause things to run with elevated privileges
CVE-12347: failure to secure root (C:) and important system directories can allow malicious actors to access them. This can be exploited to trick other parts of the system into doing ... things.
I don't mind patching git for windows to workaround these things, but sheesh, the root cause of both of these is people using Windows incorrectly/insecurely.
by hsbauauvhabzb on 4/13/22, 1:57 AM
by wheybags on 4/13/22, 8:30 AM
And of course the unspoken: almost nobody uses git on multi user systems, and when they do, most of the time every single user already has sudo.
by RayJSeth on 4/13/22, 1:52 AM
We operate some number of repositories and the majority of them use https://github.com/actions-ecosystem/action-get-latest-tag - or more specifically, a fork of that repo which more or less works the same way.
Midday today our CI/CD started failing. We must have hit this so soon because the `apk add git` in that Dockerfile grabbed the new git version. Evidently the SID that ultimately executed the git command inside the included actions' dockerfile was not the same as the one that owned `/github/workspace` on the runner.
We were able to patch around using the new `safe.directory` option, but I'm curious to see if there's more fallout since CI/CD environments in particular create this sort of shared repository.
by AussieWog93 on 4/13/22, 3:50 AM
by chrismarlow9 on 4/13/22, 4:16 AM