{"id":"CVE-2026-63476","aliases":["CVE-2026-63476","GHSA-9x82-4j54-863h"],"related":[],"kind":"vulnerability","state":"published","title":"isomorphic-git: Unbounded memory allocation from attacker-controlled delta target size (DoS)","summary":"isomorphic-git is a pure JavaScript implementation of Git for Node.js and browsers. Prior to 1.38.6, isomorphic-git reads a server-controlled targetSize while applying a packfile delta in src/utils/applyDelta.js and passes it without a bound to Buffer.alloc(targetSize). A malicious or man-in-the-middle-controlled remote can send one delta header that causes git.clone() or git.fetch() to allocate approximately 2 GB before validating the actual delta output. GitPackIndex.fromPack swallows the later size-mismatch error, so a host with sufficient memory may retain the resource waste without a visible failure, while containers, serverless functions, and small virtual machines may terminate. Node.js heap limits do not mitigate the off-heap Buffer allocation. This issue is fixed in version 1.38.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"isomorphic-git is a pure JavaScript implementation of Git for Node.js and browsers. Prior to 1.38.6, isomorphic-git reads a server-controlled targetSize while applying a packfile delta in src/utils/applyDelta.js and passes it without a bound to Buffer.alloc(targetSize). A malicious or man-in-the-middle-controlled remote can send one delta header that causes git.clone() or git.fetch() to allocate approximately 2 GB before validating the actual delta output. GitPackIndex.fromPack swallows the later size-mismatch error, so a host with sufficient memory may retain the resource waste without a visible failure, while containers, serverless functions, and small virtual machines may terminate. Node.js heap limits do not mitigate the off-heap Buffer allocation. This issue is fixed in version 1.38.6.","source":"cvelist"},{"lang":"en","text":"### Summary\nWhen applying a delta object from a packfile, isomorphic-git reads a **server-controlled** `targetSize` and calls `Buffer.alloc(targetSize)` with no upper bound. A single malicious HTTP response to `git.clone()`/`git.fetch()` can force a ~2 GB allocation → memory exhaustion / DoS (process killed on memory-constrained hosts).\n\n### Details\n`src/utils/applyDelta.js`:\n\n```js\nconst sourceSize = readVarIntLE(reader)\nconst targetSize = readVarIntLE(reader)   // attacker-controlled\n…\ntarget = Buffer.alloc(targetSize)\n```\n\nA pack with one `OBJ_REF_DELTA` whose header declares `targetSize = 0x7FFFFFFF` (~2 GB) and a 1-byte op causes the full allocation up front. The subsequent size-mismatch error is swallowed in `GitPackIndex.fromPack`, so on a host with spare RAM it silently wastes ~2 GB; on a small host the OS `SIGKILL`s the process.\n\n#### Canonical git behavior (divergence)\ngit rejects the same 78-byte pack in ~96 ms — `error: delta replay has gone wild` / `fatal: … failed to apply delta` — with no large allocation and no hang (it bounds delta replay against the declared size rather than trusting it).\n\n### PoC\n`https://github.com/spiceoverflow/av4-oom` — open in a Codespace; a single clone/fetch against the bundled server, run under `--max-old-space-size=256`:\n\n```\n[AV-4] *** OOM ALLOCATION CONFIRMED — Buffer.alloc(targetSize) RAN ***\n[AV-4] External (Buffer) memory rose by 2048 MB during clone.\n```\n\n(The allocation is off-heap, so a Node heap cap does not mitigate it.)\n\n### Impact\nA denial of service via unbounded memory allocation: a single response from a malicious or MitM'd server to `git.clone()`/`git.fetch()` forces a multi-gigabyte allocation, crashing the process on memory-constrained hosts.\n\nAny application or service that clones or fetches from untrusted/compromised remotes with isomorphic-git — most acutely containers, serverless functions, and small VMs, where the OS OOM-kills the process.\n\n### Suggested fix\nDon't pre-allocate the untrusted `targetSize`: build the result from the actual delta ops and validate the total against `targetSize` before concatenating (and/or cap it against the advertised pack size).","format":"markdown","source":"ghsa"}],"published":"2026-11-03T19:44:06.908Z","modified":"2026-11-23T21:15:06.114Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-400","CWE-789"],"affected":[{"ranges":[{"version":"< 1.38.6","status":"affected"}],"vendor":"isomorphic-git","product":"isomorphic-git","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.38.6"}],"ecosystem":"npm","package":"isomorphic-git","purl":"pkg:npm/isomorphic-git","source":"ghsa"}],"references":[{"url":"https://github.com/isomorphic-git/isomorphic-git/security/advisories/GHSA-9x82-4j54-863h","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/isomorphic-git/isomorphic-git/pull/2370","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/isomorphic-git/isomorphic-git/commit/823843d1cd19182df79bc907c767f5bcecb39a0b","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/isomorphic-git/isomorphic-git/releases/tag/v1.38.6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63476","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/isomorphic-git/isomorphic-git/pull/2373","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/isomorphic-git/isomorphic-git/commit/5c37ea69e9691183fc52d41ba7b6361263e9fedd","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/isomorphic-git/isomorphic-git","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-11-07T03:27:18.874Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-63476","url":"https://www.cve.org/CVERecord?id=CVE-2026-63476","licence":"CVE Terms of Use","modified":"2026-11-07T03:27:39.077Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9x82-4j54-863h","url":"https://github.com/advisories/GHSA-9x82-4j54-863h","licence":"CC-BY-4.0","modified":"2026-11-23T21:15:06.114Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-63476","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63476","licence":"Public domain","modified":"2026-11-07T04:17:32.990Z"}],"updatedAt":"2026-11-25T22:59:48.611Z","epss":{"score":0.00393,"percentile":0.35596,"date":"2026-12-01T12:00:22.000Z"}}