GHSA-p634-w6r4-rjp2
adm-zip: Duplicate ZIP entry names: getEntry() and extractAllTo() resolve to different content
- Risk score
- 40/100
- CVSS
- 5.9 v3.1
- Published
- 29 Sep 2026
Open in the live forecast Today's forecast
What to know
- What it is
- A ZIP file can contain two entries with the identical name. adm-zip keeps both in its internal entry list, but its name-lookup table only retains the last one written. getEntry(name) and extractAllTo() walk these two different internal structures, so they can each resolve a duplicate name to a *different* entry. An ap…
- Affected
- adm-zip (npm) <= 0.6.0
- Fix
- Upgrade adm-zip to 0.6.1 or later.
- Exploitation
- No known exploitation
Story map
At a glance
adm-zip: Amber, patch this week. Denial of Service in adm-zip's async decompression API allows an unauthenticated attacker to crash the entire Node.js host process by supplying a single malformed ZIP file. Affected package: adm-zip Affected versions: at least 0.6.0 (current latest); likely all versions containing the current inflateAsync implementati…
The flaws
- GHSA-p634-w6r4-rjp2: Duplicate ZIP entry names: getEntry() and extractAllTo() resolve to different content (CVSS 5.9)
- GHSA-8238-w5pm-2374: Unhandled error event in async DEFLATE decompression crashes Node.js process (DoS) (CVSS 7.5)
- GHSA-rcw4-f5rp-g42v: Decompression-bomb protection (fix for CVE-2026-39244) can be bypassed by declaring uncompressed size as 0 (CVSS 7.5)
- CVE-2026-102282: Adm-zip extraction preserves SUID/SGID bits from untrusted ZIPs -> local privilege escalation (CVSS 7.1 · EPSS 0%)
The fix
Upgrade adm-zip: 0.6.1 or later on your release line
Who is exposed: adm-zip (npm) <= 0.6.0
Where it stands
- Public proof of concept
Connects to
- Same weakness: CWE-436 (CWE-436). 21 other warnings in 30 days
Why it is Yellow
- CVSS 5.9 medium
- On your watchlist: npm
Affected packages
| Package | Ecosystem | Vulnerable | Fixed in |
|---|---|---|---|
| adm-zip | npm | <= 0.6.0 | 0.6.1 |
References
- https://github.com/advisories/GHSA-p634-w6r4-rjp2
- https://github.com/cthackers/adm-zip/security/advisories/GHSA-p634-w6r4-rjp2
- https://github.com/cthackers/adm-zip/commit/05101d47b3b983b705cc3e66fc34366118ba7b99
- https://github.com/cthackers/adm-zip/releases/tag/v0.6.1
- https://github.com/advisories/GHSA-p634-w6r4-rjp2
Original description
### Summary A ZIP file can contain two entries with the identical name. adm-zip keeps both in its internal entry list, but its name-lookup table only retains the last one written. `getEntry(name)` and `extractAllTo()` walk these two different internal structures, so they can each resolve a duplicate name to a *different* entry. An application that validates a named entry's contents via `getEntry()` before trusting an archive, then extracts the whole archive, can end up approving one file's content while a different file's bytes are what actually land on disk under that name. ### Details - `zipFile.js:58-83` retains both entries in `entryList` but overwrites `entryTable[name]` with only the last one written. - `adm-zip.js:83-95,658-663` uses `entryTable` for `getEntry()` lookups — returns the *last* duplicate. - `adm-zip.js:769-914` iterates `entryList` for extraction — writes the *first* duplicate (sync, default overwrite policy). ### PoC ```js const AdmZip = require('adm-zip'); const z = new AdmZip({ noSort: true }); z.addFile('a.txt', Buffer.from('FIRST')); z.addFile('b.txt', Buffer.from('SECOND')); const raw = Buffer.from(z.toBuffer()); // rename the a.txt entry to b.txt directly in the raw bytes for (let at = raw.indexOf('a.txt'); at >= 0; at = raw.indexOf('a.txt', at + 5)) { raw.write('b.txt', at); } const parsed = new AdmZip(raw, { noSort: true }); const validated = parsed.getEntry('b.txt').getData().toString(); parsed.extractAllTo(outDir, false); // validated === "SECOND", but the file written to disk === "FIRST" ``` Reproduced on the pinned commit (`2b4d84087d45344643e0183756e19191d52815cc`) ### Impact An application that checks a named entry's content before trusting an untrusted ZIP, then extracts it, can be made to approve different bytes than what actually gets written to disk — the classic check/use split that this kind of validate-then-extract pattern relies on.
Last activity 29 Sep 2026. Patch Forecast updates every hour.