CVE-2022-24765
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 · uneditedGit 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 confidenceGit 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.
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< 2.35.2= 34= 35= 36= 37= 10.0< 13.4CVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Check installed Git version on WindowsRun `git --version` in command prompt or PowerShell and compare the version number to 2.35.2Affected if Version is below 2.35.2 (e.g., 2.35.1, 2.34.1, etc.)
-
Verify OS is WindowsRun `systeminfo | findstr /B /C:OS` or check if running Windows 10/11, Windows ServerAffected if Operating system is Windows (this vulnerability affects Windows-specific Git behavior)
-
Check for presence of C:\.git directoryOpen File Explorer or run `dir C:\.git` in command prompt to see if a .git folder exists at the root of the C: driveAffected if A `.git` directory exists at `C:\.git` (or similar root paths on other drives)
-
Check Git config search path behaviorRun `git config --list --show-origin` outside any Git repository to see which config files Git is reading and from what locationsAffected if Git is reading configuration from a path outside the expected repository structure (e.g., from C:\.git\config)
-
Check file system permissions on C:\.gitRun `icacls C:\.git` or right-click the folder > Properties > Security to see who has write accessAffected 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.
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 · scoped2.35.213.4
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`).
Git for Windows >= 2.35.2
- 1. Check current Git version by running `git --version` in Git Bash or Command Prompt
- 2. Download Git for Windows version 2.35.2 or later from the official website: https://git-scm.com/download/win
- 3. Run the installer and follow the installation wizard
- 4. Verify the upgrade was successful by running `git --version` again
- 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. 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
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation6.0 h
- Testing3.0 h
- Review / QA2.0 h
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 locallyCheck 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- git-scm.com
- git-scm.com
- github.com
- seclists.org
- www.openwall.com
- lists.debian.org
- support.apple.com
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- lists.fedoraproject.org
- security.gentoo.org
- nvd.nist.gov
Practitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2022-24765 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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