GitApplication · Git Scm

CVE-2022-24765

HIGH · 7.8 CVSS v3.1 Published 2022-04-12
Fix available
A fix is available. Upgrade to 2.35.2 / 13.4 or later.
See remediation →
80/100
Remediation priority · High
Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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`.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Git for Windows versions prior to v2.35.2 contain a path traversal vulnerability where Git operations executed outside a repository will search for and respect config files in a malicious `C:\.git` directory if one exists on the system. This allows untrusted parties with disk write access on multi-user machines to inject arbitrary Git configuration, potentially executing commands or modifying behavior of Git operations.

MitigationUpgrade Git for Windows to v2.35.2 or later. If upgrading is not possible immediately, create a `.git` folder on all drives and restrict permissions, or set `GIT_CEILING_DIRECTORIES` to cover the parent of user profiles (e.g., `C:\Users`).

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
GitApplication
Affected:< 2.35.2
FedoraOperating system
Affected:= 34= 35= 36= 37
Debian LinuxOperating system
Affected:= 10.0
XcodeApplication
Affected:< 13.4

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
Low
Privileges
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check installed Git version on Windows
    Run `git --version` in command prompt or PowerShell and compare the version number to 2.35.2
    Affected if Version is below 2.35.2 (e.g., 2.35.1, 2.34.1, etc.)
  2. Verify OS is Windows
    Run `systeminfo | findstr /B /C:OS` or check if running Windows 10/11, Windows Server
    Affected if Operating system is Windows (this vulnerability affects Windows-specific Git behavior)
  3. Check for presence of C:\.git directory
    Open File Explorer or run `dir C:\.git` in command prompt to see if a .git folder exists at the root of the C: drive
    Affected if A `.git` directory exists at `C:\.git` (or similar root paths on other drives)
  4. Check Git config search path behavior
    Run `git config --list --show-origin` outside any Git repository to see which config files Git is reading and from what locations
    Affected if Git is reading configuration from a path outside the expected repository structure (e.g., from C:\.git\config)
  5. Check file system permissions on C:\.git
    Run `icacls C:\.git` or right-click the folder > Properties > Security to see who has write access
    Affected if Non-admin or untrusted users have Write or Full Control permissions to a C:\.git directory

You are affected if you are running Git for Windows versions below 2.35.2 on Windows, and a C:\.git directory exists with permissions allowing untrusted users to write to it.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 2.35.2 / 13.4 or later
Fixed in 2.35.213.4
Interim mitigation

Upgrade Git for Windows to v2.35.2 or later. If upgrading is not possible immediately, create a `.git` folder on all drives and restrict permissions, or set `GIT_CEILING_DIRECTORIES` to cover the parent of user profiles (e.g., `C:\Users`).

Recommended fix High confidence

Git for Windows >= 2.35.2

  1. 1. Check current Git version by running `git --version` in Git Bash or Command Prompt
  2. 2. Download Git for Windows version 2.35.2 or later from the official website: https://git-scm.com/download/win
  3. 3. Run the installer and follow the installation wizard
  4. 4. Verify the upgrade was successful by running `git --version` again
  5. 5. Alternatively, if unable to upgrade immediately, create a `.git` folder on the root of each drive (e.g., C:\.git, D:\.git) and remove read/write permissions from those folders as a workaround
  6. 6. Alternatively, set the environment variable `GIT_CEILING_DIRECTORIES` to `C:\Users` (or the parent directory of your user profile) to limit Git's search scope
Caveat Minimal risk; this is a security patch upgrade with no expected breaking changes for normal Git operations

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Git Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing3.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,490
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,984.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-24765 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-24765 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data