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

@mcollina mcollina commented Aug 4, 2026

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-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Aug 4, 2026
@mcollina
mcollina requested a review from aduh95 August 4, 2026 08:26
@pipobscure

Copy link
Copy Markdown
Contributor

lgtm 👍

@codecov

codecov Bot 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 lines Coverage Δ
lib/internal/zip/entry.js 98.44% <100.00%> (+<0.01%) ⬆️
lib/internal/zip/headers.js 97.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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants