zlib: reject ambiguous ZIP archive ends · nodejs/node@8e848d9 · GitHub
Skip to content

Commit 8e848d9

Browse files
mcollinaaduh95
authored andcommitted
zlib: reject ambiguous ZIP archive ends
ZIP archives can contain more than one structurally plausible EOCD record. Selecting based on whether a comment reaches EOF can make the chosen central directory depend on trailing padding. Inspect all candidates in the common tail window and reject archives with multiple plausible interpretations. Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #65007 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent df48191 commit 8e848d9

2 files changed

Lines changed: 143 additions & 17 deletions

File tree

lib/internal/zip/headers.js

Lines changed: 68 additions & 15 deletions

test/parallel/test-zlib-zip-hardening.js

Lines changed: 75 additions & 2 deletions

0 commit comments

Comments
 (0)