Skip to content

zlib: validate central directory record count - #65002

Open
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:fix-zlib-zip-central-directory-count
Open

zlib: validate central directory record count#65002
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:fix-zlib-zip-central-directory-count

Conversation

@mcollina

Copy link
Copy Markdown
Member

ZIP readers trusted the EOCD record count without checking that the parsed headers consumed the declared central directory size. Reject archives whose record count leaves central directory bytes unparsed so all ZIP reader paths agree on the archive's entries.

ZIP readers trusted the EOCD record count. They did not check that
the parsed headers consumed the declared central directory size.
Reject archives whose count leaves directory bytes unparsed.
Signed-off-by: Matteo Collina <hello@matteocollina.com>
@nodejs-github-botnodejs-github-bot added the needs-ci PRs that need a full CI run. label Aug 4, 2026
@mcollina
mcollina requested a review from aduh95August 4, 2026 08:26
@pipobscure

Copy link
Copy Markdown
Contributor

lgtm 👍

@codecov

codecovBot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.27%. Comparing base (f43086d) to head (3469b1b).
⚠️ Report is 37 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #65002 +/- ##
=======================================
Coverage 90.27% 90.27% =======================================
Files 762 762 Lines 247515 247540 +25 Branches 46683 46690 +7 =======================================
+ Hits 223447 223478 +31 - Misses 15485 15489 +4 + Partials 8583 8573 -10 
Files with missing linesCoverage Δ
lib/internal/zip/entry.js98.44% <100.00%> (+<0.01%)⬆️
lib/internal/zip/headers.js97.28% <100.00%> (+0.02%)⬆️

... and 39 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@mcollina@pipobscure@panva@nodejs-github-bot