high

CVE-2026-77355

npm · isomorphic-git

Summary

isomorphic-git: NTFS .git::$INDEX_ALLOCATION alias bypass writes into the active gitdir

Severity
high
CVSS
8.8
EPSS
0.9% (p60)
CWE
CWE-22
Also known as
GHSA-6fxm-h49m-4fg3
Published
2026-11-30
Updated
2026-11-30

Advisory details

Summary

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_ALLOCATION

aliases 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 streamintroduced in transit—not necessarily a repository hosted on GitHub.com.

Affected product

At the time of validation on 2026-07-10, 1.38.6 was the latest published version.

Severity

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:

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

Run

From the extracted package directory in PowerShell:

cd .\poc
powershell -ExecutionPolicy Bypass -File .\run-poc.ps1

The script performs four checks:

  1. Builds a bare repository containing the raw root-tree entry .git::$INDEX_ALLOCATION.
  2. Serves it over loopback smart HTTP through git http-backend.
  3. Clones it with exact isomorphic-git@1.38.6 and verifies that the real .git/config and real .git/hooks/vantix-fsmonitor.bat are attacker-controlled.
  4. Confirms the marker is absent, runs native git status, and verifies that VANTIX_MARKER.txt is 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: true

The 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:

Impact

A malicious repository can modify trusted repository metadata during clone or checkout on Windows NTFS. Depending on the written file, this can cause:

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

References

Related advisories

Is your project exposed to this? Stateward checks every dependency on every pull request and flags it only if your code actually reaches it.

Check my repo

Summarize with AI

ChatGPTClaudePerplexity

Sources: CISA KEV (public domain), OSV.dev & GitHub Advisory Database (CC-BY-4.0), FIRST EPSS, NVD/CWE (public domain). Served live from the Stateward advisory database.