CVE-2022-31012 Git for Windows' installer can be tricked into executing an untrusted binary

High 8.2 Published Updated

Git for Windows installer may execute an untrusted binary during fresh installation, allowing local attackers to run arbitrary code.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2022-31012?

CVE-2022-31012 is a high-severity path traversal vulnerability in git-for-windows git, published on 12 Jul 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

Git for Windows is a fork of Git that contains Windows-specific patches. This vulnerability in versions prior to 2.37.1 lets Git for Windows' installer execute a binary into `C:\mingw64\bin\git.exe` by mistake. This only happens upon a fresh install, not when upgrading Git for Windows. A patch is included in version 2.37.1. Two workarounds are available. Create the `C:\mingw64` folder and remove read/write access from this folder, or disallow arbitrary authenticated users to create folders in `C:\`.

Weakness: CWE-426

Which versions are affected by CVE-2022-31012?

It affects 1 product.

Products include Gitforwindows Git.

How do I fix CVE-2022-31012?

No fix has been published for CVE-2022-31012 yet. Limit exposure of the affected software until one is available.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2022-31012 being exploited?

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

Sources

Also known as GHSA-gjrj-fxvp-hjj2.

Is CVE-2022-31012 in your software?

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

Check your SBOMs for free