Skip to content

Uncontrolled search for the Git directory in Microsoft's fork of Git

High
derrickstolee published GHSA-3phr-pfxm-cm63 Apr 20, 2022

Package

No package listed

Affected versions

<2.35.3.vfs.0.0

Patched versions

2.35.3.vfs.0.0

Description

Impact

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.

Users of the Microsoft fork of Git are vulnerable simply by starting a Git Bash with the current working directory outside of a trusted Git repository.

Patches

The problem has been addressed in v2.35.2.vfs.0.0.

Workarounds

Create the folder .git on all drives where Git commands are run, and remove read/write access from those folders:

mkdir \.git
icacls \.git /inheritance:r

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.

References

For more information

If you have any questions or comments about this advisory:

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

CVE ID

No known CVE

Weaknesses