CVE-2022-29187 Bypass of safe.directory protections in Git

High 7.8 Published Updated

Attackers can escalate privileges by exploiting safe.directory bypasses when root users navigate attacker-controlled Git repositories.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-29187?

CVE-2022-29187 is a high-severity vulnerability in Apple Xcode, published on 12 Jul 2022. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

Git is a distributed revision control system. Git prior to versions 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, and 2.30.5, is vulnerable to privilege escalation in all platforms. An unsuspecting user could still be affected by the issue reported in CVE-2022-24765, for example when navigating as root into a shared tmp directory that is owned by them, but where an attacker could create a git repository. Versions 2.37.1, 2.36.2, 2.35.4, 2.34.4, 2.33.4, 2.32.3, 2.31.4, and 2.30.5 contain a patch for this issue. The simplest way to avoid being affected by the exploit described in the example is to avoid running git as root (or an Administrator in Windows), and if needed to reduce its use to a minimum. While a generic workaround is not possible, a system could be hardened from the exploit described in the example by removing any such repository if it exists already and creating one as root to block any future attacks.

Weakness: CWE-427, CWE-282

Which versions are affected by CVE-2022-29187?

It affects 4 products.

Linux distribution packages (40)
git SUSE:Enterprise Storage 6All versions2.26.2-150000.41.1
git SUSE:Enterprise Storage 7All versions2.26.2-150000.41.1
git SUSE:HPE Helion OpenStack 8All versions2.26.2-27.57.1
git SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise High Performance Computing 15 SP2-ESPOSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise High Performance Computing 15-ESPOSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise High Performance Computing 15-LTSSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Module for Basesystem 15 SP3All versions2.35.3-150300.10.15.1
git SUSE:Linux Enterprise Module for Basesystem 15 SP4All versions2.35.3-150300.10.15.1
git SUSE:Linux Enterprise Module for Development Tools 15 SP3All versions2.35.3-150300.10.15.1
git SUSE:Linux Enterprise Module for Development Tools 15 SP4All versions2.35.3-150300.10.15.1
git SUSE:Linux Enterprise Server 12 SP2-BCLAll versions2.26.2-27.57.1
git SUSE:Linux Enterprise Server 12 SP3-BCLAll versions2.26.2-27.57.1
git SUSE:Linux Enterprise Server 12 SP4-LTSSAll versions2.26.2-27.57.1
git SUSE:Linux Enterprise Server 12 SP5All versions2.26.2-27.57.1
git SUSE:Linux Enterprise Server 15 SP1-BCLAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Server 15 SP1-LTSSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Server 15 SP2-BCLAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Server 15 SP2-LTSSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Server 15-LTSSAll versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Server for SAP Applications 12 SP4All versions2.26.2-27.57.1
git SUSE:Linux Enterprise Server for SAP Applications 12 SP5All versions2.26.2-27.57.1
git SUSE:Linux Enterprise Server for SAP Applications 15All versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Server for SAP Applications 15 SP1All versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Server for SAP Applications 15 SP2All versions2.26.2-150000.41.1
git SUSE:Linux Enterprise Software Development Kit 12 SP5All versions2.26.2-27.57.1
git SUSE:Manager Proxy 4.1All versions2.26.2-150000.41.1
git SUSE:Manager Retail Branch Server 4.1All versions2.26.2-150000.41.1
git SUSE:Manager Server 4.1All versions2.26.2-150000.41.1
git SUSE:OpenStack Cloud 8All versions2.26.2-27.57.1
git SUSE:OpenStack Cloud 9All versions2.26.2-27.57.1
git SUSE:OpenStack Cloud Crowbar 9All versions2.26.2-27.57.1
git openSUSE:Leap 15.3All versions2.26.2-150000.41.1
git openSUSE:Leap 15.3All versions2.35.3-150300.10.15.1
git openSUSE:Leap 15.4All versions2.26.2-150000.41.1
git openSUSE:Leap 15.4All versions2.35.3-150300.10.15.1
git openSUSE:TumbleweedAll versions2.37.1-1.1
libgit2 openSUSE:TumbleweedAll versions1.7.1-3.1

Products include Apple Xcode, Debian Debian Linux, Fedoraproject Fedora, Git-Scm Git.

How do I fix CVE-2022-29187?

Upgrade to a fixed version.

Is CVE-2022-29187 being exploited?

There is no known exploitation of CVE-2022-29187 in the wild and no public exploit code.

All Apple Xcode vulnerabilities

Sources

Also known as ALPINE-CVE-2022-29187, CLEANSTART-2026-EQ09700, DEBIAN-CVE-2022-29187, GHSA-j342-m5hw-rr3v, OESA-2022-1765, SUSE-SU-2022:2535-1 and 6 more.

Is CVE-2022-29187 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free