isomorphic-gitに任意のファイルを書き換えられる脆弱性、修正版は1.38.8
Summary
isomorphic-gitのgit cherry-pick処理に、シンボリックリンクを経由して作業ツリーの外のファイルへ書き込まれる脆弱性が見つかりました。1.38.8より前のバージョンが影響を受け、任意のファイルの改ざんやコード実行につながるおそれがあります。修正版の1.38.8に更新してください。
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のgit cherry-pick処理に、シンボリックリンクを経由して作業ツリーの外のファイルへ書き込まれる脆弱性が見つかりました。1.38.8より前のバージョンが影響を受け、任意のファイルの改ざんやコード実行につながるおそれがあります。修正版の1.38.8に更新してください。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| isomorphic-gitisomorphic-git | — | Not listed |
| npmisomorphic-git |
< 1.38.8→ 1.38.8 |
1.38.8 |
Original description The description as published by the source.
Summary
There is an arbitrary file write vulnerability in isomorphic-git (verified on v1.38.7). When applying tree changes during git cherry-pick, the helper applyTreeChanges materializes files by joining the worktree root with the entry path and writing the blob contents, but it never checks whether any leading path component is a symbolic link. An attacker who can cause a victim repository to contain a tracked symlink such as link -> / can later supply a cherry-pick tree containing link/tmp/; isomorphic-git follows the symlink and writes the file outside the worktree. This vulnerability may lead to remote code execution, privilege escalation, data corruption, or denial of service.
Details
The vulnerable logic is in applyTreeChanges at src/utils/walkerToTreeEntryMap.js:260-295. For every changed blob it builds the on-disk path and writes it directly:
// src/utils/walkerToTreeEntryMap.js:260-295
// apply the changes to work dir
await acquireLock({ fs, gitdir, dirRemoved, ops }, async () => {
for (const op of ops) {
const currentFilepath = join(dir, op.filepath)
switch (op.method) {
// ...
case 'write':
// only writes if file is not in the removedDirs
if (
!dirRemoved.some(removedDir =>
currentFilepath.startsWith(removedDir)
)
) {
const { object } = await _readObject({
fs,
cache: {},
gitdir,
oid: o…
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