Summary
Git for Windows can process a malicious bundle URI advertised by a remote Git server as a local Windows path when bundle URI support is enabled. During clone or fetch, this behavior may cause an outbound SMB connection to an attacker-controlled host, exposing NTLM authentication material.
Affected context
The issue can occur in Git for Windows installations that enable bundle URI handling through transfer.bundleuri=true and connect to a malicious or compromised Git server. The risk arises when non-HTTP(S) bundle locations are interpreted as local filesystem paths and Windows-specific UNC or file URI references are processed during clone or fetch.
Exploit preconditions
- Attack surface: Git clone or fetch operations involving a remote server
- Required access: The attacker must control or influence the remote Git server's advertised bundle URI
- Trigger point: Bundle URI retrieval through the Git transport and file-copy handling paths
- Why exploitation is possible: Non-HTTP(S) values may be treated as filesystem locations, allowing a remote-controlled path to initiate an outbound SMB connection
Why this happens
The underlying bug is insufficient validation and trust-boundary enforcement for remotely advertised bundle URI values on Windows. URI handling removes file URI prefixes and permits path forms that can reference network shares, causing a client-side network authentication attempt to an attacker-selected host. This behavior maps primarily to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, with CWE-610: Externally Controlled Reference to an Object describing the use of attacker-influenced references.
Potential impact
- NTLM authentication material may be exposed to an attacker-controlled host
- An attacker could attempt offline analysis or relay of captured authentication data
- User or service account identities may be disclosed through outbound authentication
- Organizational network location and trust relationships could be revealed
- Repeated exposure could increase the risk of broader credential compromise
General mitigation guidance
Mitigation generally focuses on treating all server-advertised bundle locations as untrusted data and preventing them from initiating unintended network authentication.
Common defensive patterns include:
- Restricting bundle URI handling to explicitly supported, authenticated transport schemes
- Rejecting UNC paths, local filesystem references, and ambiguous file URI forms from remote metadata
- Applying strict canonicalization and allowlisting before any path or transport operation
- Disabling optional bundle retrieval where it is not required by operational workflows
- Limiting outbound SMB traffic from developer workstations and build environments
- Running Git operations with least-privileged accounts and minimizing credential exposure
- Using network policies that prevent unnecessary authentication to untrusted hosts
How teams detect issues like this
Detection can combine source analysis, runtime telemetry, and policy enforcement:
- Use static analysis to identify remote metadata flowing into filesystem, UNC, or network-share APIs
- Review code for scheme allowlisting, path canonicalization, and validation performed before transport selection
- Monitor Git clients for unexpected outbound SMB connections during clone or fetch activity
- Alert on NTLM authentication attempts to external, untrusted, or newly observed hosts
- Enforce endpoint and network policies that restrict SMB egress and unsolicited credential negotiation
- Add automated security review rules for externally controlled URI values reaching file or network operations

