Skip to content

contrib/minizip: neutralize directory Zip-Slip in miniunz - #1285

Open
M0nd0R wants to merge 3 commits into
madler:developfrom
M0nd0R:fix/miniunz-dir-zipslip
Open

contrib/minizip: neutralize directory Zip-Slip in miniunz#1285
M0nd0R wants to merge 3 commits into
madler:developfrom
M0nd0R:fix/miniunz-dir-zipslip

Conversation

@M0nd0R

@M0nd0R M0nd0R commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • Incomplete CVE-2014-9485 / contrib/minizip: neutralize traversal attacks in miniunz cli #908 fix: file members were neutralized, but directory-only archive entries still called mymkdir() on the raw member name.
  • Crafted ZIPs with chained ../ directory entries can create directory trees outside the extraction root.
  • Factor a component-aware neutralize_extract_path() used by both file and directory branches; preserve legitimate .hidden names; use makedir() after neutralization.

Test plan

  • Built contrib/minizip/miniunz against current develop
  • ZIP with ../escape/, ../escape/a/, ../escape/a/b/ no longer creates siblings outside extract dir; neutralized under extract root
  • .config/ directory entries still extract with leading dot preserved
  • Normal nested ok/file.txt extract still works

Refs: #907 #908 CVE-2014-9485

M0nd0R added 3 commits July 28, 2026 09:18
CVE-2014-9485 mitigation (madler#908) only sanitized file member names.
Directory-only entries still called mymkdir() on the raw archive path,
so chained ../ directory members could create trees outside the extract
root.

Share a component-aware neutralize_extract_path() for both branches,
preserve .hidden names, and use makedir() after neutralization.
CVE-2014-9485 mitigation (madler#908) only sanitized file member names.
Directory-only entries still called mymkdir() on the raw archive path,
so chained ../ directory members could create trees outside the extract
root.

Share a component-aware neutralize_extract_path() for both branches,
preserve .hidden names, and use makedir() after neutralization.
CVE-2014-9485 mitigation (madler#908) only sanitized file member names.
Directory-only entries still called mymkdir() on the raw archive path,
so chained ../ directory members could create trees outside the extract
root.

Share a component-aware neutralize_extract_path() for both branches,
preserve .hidden names, and use makedir() after neutralization.
@Neustradamus

Copy link
Copy Markdown

@gvollant: Can you look it?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants