Skip to content

Commit d5e5c1d

Browse files
committed
Merge tag 'v2.53.0.windows.3' into merge-v2.53.0.windows.3-into-vfs-2.53.0
Git for Windows v2.53.0(3) Changes since Git for Windows v2.53.0(2) (March 10th 2026): This is a security fix release, addressing CVE-2026-32631. * CVE-2026-32631, Git for Windows: When a user clones a repository containing symbolic links pointing to network drives, Git follows those symlinks during checkout, causing Windows to transparently perform NTLM authentication and disclose the user's NTLMv2 hash to an attacker-controlled server. Since NTLM hashing is weak, the captured hash can potentially be brute-forced to recover the user's credentials. This is addressed by preventing git clone from following symbolic links that point to network drives during checkout. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 parents 876169f + f8165af commit d5e5c1d

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,9 @@ jobs:
423423
CI_JOB_IMAGE: ${{matrix.vector.image}}
424424
CUSTOM_PATH: /custom
425425
runs-on: ubuntu-latest
426-
container: ${{matrix.vector.image}}
426+
container:
427+
image: ${{ matrix.vector.image }}
428+
options: ${{ github.repository_visibility == 'private' && '--pids-limit 16384 --ulimit nproc=16384:16384 --ulimit nofile=32768:32768' || '' }}
427429
steps:
428430
- name: prepare libc6 for actions
429431
if: matrix.vector.jobname == 'linux32'

compat/mingw.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,29 @@ process_phantom_symlink(const wchar_t *wtarget, const wchar_t *wlink)
385385
wchar_t relative[MAX_LONG_PATH];
386386
const wchar_t *rel;
387387

388+
/*
389+
* Do not follow symlinks to network shares, to avoid NTLM credential
390+
* leak from crafted repositories (e.g. \\attacker-server\share).
391+
* Since paths come in all kind of enterprising shapes and forms (in
392+
* addition to the canonical `\\host\share` form, there's also
393+
* `\??\UNC\host\share`, `\GLOBAL??\UNC\host\share` and also
394+
* `\Device\Mup\host\share`, just to name a few), we simply avoid
395+
* following every symlink target that starts with a slash.
396+
*
397+
* This also catches drive-less absolute paths, of course. These are
398+
* uncommon in practice (and also fragile because they are relative to
399+
* the current working directory's drive). The only "harm" this does
400+
* is that it now requires users to specify via the Git attributes if
401+
* they have such an uncommon symbolic link and need it to be a
402+
* directory type link.
403+
*/
404+
if (is_wdir_sep(wtarget[0])) {
405+
warning("created file symlink '%ls' pointing to '%ls';\n"
406+
"set the `symlink` gitattribute to `dir` if a "
407+
"directory symlink is required", wlink, wtarget);
408+
return PHANTOM_SYMLINK_DONE;
409+
}
410+
388411
/* check that wlink is still a file symlink */
389412
if ((GetFileAttributesW(wlink)
390413
& (FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_DIRECTORY))

0 commit comments

Comments
 (0)