Skip to content

Validate MPK entry paths before extraction writes - #3

Merged
GG-O-BP merged 1 commit into
mainfrom
fix/zip-entry-path-traversal
Sep 3, 2026
Merged

Validate MPK entry paths before extraction writes#3
GG-O-BP merged 1 commit into
mainfrom
fix/zip-entry-path-traversal

Conversation

@GG-O-BP

@GG-O-BP GG-O-BP commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • mendraw#3 reported ZipSlip through unvalidated archive entry names. Reproduction against the current mxpak pipeline showed Erlang/OTP zip:unzip(..., [memory]) already normalizes upward traversal (../evil.txt becomes evil.txt).
  • The remaining real gap was backslash entry names, which OTP returns verbatim and which become path separators on Windows; mpk/zip.extract now rejects empty, absolute, ..-containing, and backslash entry names before any cache or project write.
  • Regression tests lock both layers: OTP sanitization for ../evil.txt, explicit rejection for a real ..\evil.txt archive, nested valid paths, and truncated archives.

Fixes glendix-labs/mendraw#3

Verification

  • gleam test — 107 passed.
  • ./scripts/verify.sh inner mxpak — passed.
  • ./scripts/check-all.sh — passed (after fixing workspace public/private ordering rules).
  • pre-push verify.sh final — passed (family checks, widget build, Lustre E2E, Mendix full E2E).

@GG-O-BP
GG-O-BP merged commit 4c8af55 into main Sep 3, 2026
@GG-O-BP
GG-O-BP deleted the fix/zip-entry-path-traversal branch September 3, 2026 00:47
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.

[보안] 다운로드한 .mpk 엔트리 경로 미검증으로 ZipSlip

1 participant