isomorphic-gitの脆弱性、Windows環境でgitdirへの書き込みを許すおそれ
Summary
isomorphic-gitの1.38.7より前のバージョンには、Windowsで NTFSの予約名を使ったパスの検証が不十分な脆弱性があります。悪意のあるリポジトリをclone()やcheckoutで展開すると、有効な.gitディレクトリへ書き込まれ、設定やフックが改ざんされるおそれがあります。修正版の1.38.7で対処されています。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
isomorphic-gitの1.38.7より前のバージョンには、Windowsで NTFSの予約名を使ったパスの検証が不十分な脆弱性があります。悪意のあるリポジトリをclone()やcheckoutで展開すると、有効な.gitディレクトリへ書き込まれ、設定やフックが改ざんされるおそれがあります。修正版の1.38.7で対処されています。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| isomorphic-gitisomorphic-git | — | Not listed |
| npmisomorphic-git |
< 1.38.7→ 1.38.7 |
1.38.7 |
Original description The description as published by the source.
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
- Ecosystem: npm
- Package:
isomorphic-git - Affected version tested:
1.38.6 - Published package commit: `823843d1cd19182df…
Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory
References
- advisory github.com
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com