NTFS .git::$INDEX_ALLOCATION alias bypass writes into the active gitdir in isomorphic-git 1.38.6
Description
isomorphic-git@1.38.6 incompletely implements Git's reserved .git pathname validation. Its tree parser rejects literal and normalized .git names and selected NTFS 8.3 aliases, but it does not reject a colon after .git.
On Windows NTFS, the directory name:
.git::$INDEX_ALLOCATIONaliases the real .git directory. A repository containing that tree entry can therefore cause clone() or checkout to write attacker-controlled files into trusted repository metadata. In the demonstrated proof, the clone replaces the real .git/config and writes a batch file under the real .git/hooks directory. A subsequent ordinary native git status reads the poisoned core.fsmonitor value and executes the marker-only batch file.
The guaranteed vulnerability is the gitdir write during isomorphic-git checkout. The command-execution step is a follow-on action by native Git or another compatible tool; isomorphic-git does not itself execute the hook.
The crafted tree may be rejected by hosting platforms that enforce Git fsck's hasDotgit check. The PoC therefore uses a researcher-controlled loopback Smart HTTP remote. The realistic reach is an untrusted or compromised self-hosted remote, a permissive Git service, or a malicious object stream introduced in transit—not necessarily a repository hosted on GitHub.com.
Affected product
- Ecosystem: npm
- Package:
isomorphic-git - Affected version tested:
1.38.6 - Published package commit:
823843d1cd19182df79bc907c767f5bcecb39a0b - npm tarball SHA-256:
d2547d46c0a23ef9fc6fb2052e01ff78c348ceb92d394be05b146bc790943858 - Platform required for the alias: Windows on NTFS
At the time of validation on 2026-07-10, 1.38.6 was the latest published version.
Severity
High — suggested CVSS 3.1: 8.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HRationale:
- An attacker can control the repository/object stream being cloned; the supplied PoC uses self-hosted Smart HTTP because stricter hosting may reject the malformed tree during fsck.
- No privileges in the victim environment are required.
- The victim or automation must clone/check out the repository, and command execution requires a later compatible Git/tool action.
- The demonstrated follow-on executes as the victim developer or CI identity.
- Scope remains unchanged; the vulnerable workflow and impacted user account are within the same security authority.
A maintainer may choose to score only the guaranteed gitdir-write primitive lower. The report intentionally does not claim direct command execution inside isomorphic-git.
Root cause
src/models/GitTree.js in v1.38.6 normalizes entry names by removing selected HFS-ignorable characters, lowercasing, and stripping trailing dots/spaces. It then rejects:
- path separators;
.and..;- normalized
.git; and - selected
git~1throughgit~9aliases.
The validation does not reject .git: or other colon-suffixed forms. The published code comments state that the checks mirror native Git's is_ntfs_dotgit() behavior, but native Git specifically treats NTFS alternate stream forms as unsafe.
The checkout leading-component hardening added in the same release checks for symbolic links. It does not stop an NTFS filesystem alias because the alias resolves as a directory, not a symlink.
Reproduction
Requirements
- A disposable Windows VM using NTFS
- Node.js 20 or newer
- Git for Windows on
PATH - No third-party target; the PoC serves only on
127.0.0.1
Run
From the extracted package directory in PowerShell:
cd .\poc
powershell -ExecutionPolicy Bypass -File .\run-poc.ps1The script performs four checks:
- Builds a bare repository containing the raw root-tree entry
.git::$INDEX_ALLOCATION. - Serves it over loopback smart HTTP through
git http-backend. - Clones it with exact
isomorphic-git@1.38.6and verifies that the real.git/configand real.git/hooks/vantix-fsmonitor.batare attacker-controlled. - Confirms the marker is absent, runs native
git status, and verifies thatVANTIX_MARKER.txtis created. It also attempts a native Git clone of the same URL as a negative control; native Git should refuse checkout.
Expected key output on Windows NTFS:
realConfigContainsFsmonitor: true
hookInRealGitdir: true
markerBeforeNativeGit: false
nativeGitStatusExit: 0
markerAfterNativeGit: trueThe batch file only writes the text VANTIX_HTTP_CLONE_MARKER to a file inside the disposable victim directory.
Independently validated behavior
The published npm tarball was downloaded and hashed independently. Its SHA-256 matches the supplied evidence. A parser-level test against the exact published bundle produced the following result:
{
".git": { "accepted": false },
".GIT ": { "accepted": false },
"git~1": { "accepted": false },
".git::$INDEX_ALLOCATION": { "accepted": true }
}The included smart-HTTP PoC was also exercised on Linux as a transport/control check. The clone completed, but Linux created a literal .git::$INDEX_ALLOCATION directory and did not overwrite .git, which matches the Windows/NTFS-specific impact claim. Native Git rejected checkout of the same crafted tree. git fsck --full also reported hasDotgit: contains '.git', confirming why strict Git hosting may block direct publication of the object.
The original Windows replay evidence records:
isomorphic-git@1.38.6clone completed without error;- the real
.git/configwas overwritten; - the real hook file was written;
- the marker was absent before native Git;
git statusexited successfully and created the marker; and- native Git cloning the identical repository refused checkout.
Impact
A malicious repository can modify trusted repository metadata during clone or checkout on Windows NTFS. Depending on the written file, this can cause:
- local repository configuration poisoning;
- execution of configured commands when native Git or another compatible tool later processes the clone;
- corruption of refs, hooks, attributes, or other gitdir state; and
- compromise of the developer or CI account running the follow-on tool.
The proof uses core.fsmonitor because git status invokes it in a normal workflow. Other gitdir targets may provide additional integrity or availability impact. isomorphic_git_1.38.6_ntfs_alias_submission.zip