CVE-2022-24765

Uncontrolled search for the Git directory in Git for Windows

HIGH
7.8
CVSS Score
Published: April 12, 2022 at 12:00 AM UTC
Updated: June 17, 2026 at 04:32 AM UTC
5 products affected across 5 vendorsDebian LinuxFedoraXcode· also runs on 1 platform

Using git by git-for-windows?

Get instant alerts when new vulnerabilities affect git - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.8
Exploit prediction
EPSS 1%
SSVC
No known exploit

Description

Git for Windows is a fork of Git containing Windows-specific patches. This vulnerability affects users working on multi-user machines, where untrusted parties have write access to the same hard disk. Those untrusted parties could create the folder `C:\.git`, which would be picked up by Git operations run supposedly outside a repository while searching for a Git directory. Git would then respect any config in said Git directory. Git Bash users who set `GIT_PS1_SHOWDIRTYSTATE` are vulnerable as well. Users who installed posh-gitare vulnerable simply by starting a PowerShell. Users of IDEs such as Visual Studio are vulnerable: simply creating a new project would already read and respect the config specified in `C:\.git\config`. Users of the Microsoft fork of Git are vulnerable simply by starting a Git Bash. The problem has been patched in Git for Windows v2.35.2. Users unable to upgrade may create the folder `.git` on all drives where Git commands are run, and remove read/write access from those folders as a workaround. Alternatively, define or extend `GIT_CEILING_DIRECTORIES` to cover the _parent_ directory of the user profile, e.g. `C:\Users` if the user profile is located in `C:\Users\my-user-name`.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 13.4
Affected range stops below 13.4, so it looks safe — our inference, not a vendor statement
v < 2.35.2
Affected range stops below 2.35.2, so it looks safe — our inference, not a vendor statement
microsoft-windows (environment)
v < 2.35.2
Affected range stops below 2.35.2, so it looks safe — our inference, not a vendor statement

Runs on — not affected

The affected product only carries this flaw when running on these platforms. The platforms themselves are not vulnerable.

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-427

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card