test: cover ZIP header-confusion and DoS guards · nodejs/node@31742f2 · GitHub
Skip to content

Commit 31742f2

Browse files
pipobscureaduh95
authored andcommitted
test: cover ZIP header-confusion and DoS guards
Add regression tests for node:zlib ZIP hardening: - A local file header that disagrees with the central directory on compression method, sizes, CRC, or the encryption flag lets another ZIP reader extract a different member from the same archive; such an archive must be rejected (fixed in a follow-up commit). - zipFiles() must reject a FIFO/special source rather than block forever on open() (fixed in a follow-up commit). - Streaming (contentIterator) is hard-bounded by the header's declared uncompressed size and rejects a member that inflates past it, so entry.size is a ceiling a consumer can trust up front; lock that in. Signed-off-by: Philipp Dunkel <pip@pipobscure.com> PR-URL: #65016 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 9b4f349 commit 31742f2

1 file changed

Lines changed: 120 additions & 0 deletions

File tree

Lines changed: 120 additions & 0 deletions

0 commit comments

Comments
 (0)