Skip to content

Add max_size extraction limit for zip bomb protection#168

Merged
ericmj merged 2 commits intomainfrom
ericmj/max-size-unpack
Mar 9, 2026
Merged

Add max_size extraction limit for zip bomb protection#168
ericmj merged 2 commits intomainfrom
ericmj/max-size-unpack

Conversation

@ericmj
Copy link
Member

@ericmj ericmj commented Mar 9, 2026

  • Backport {max_size, N} extraction option from OTP's erl_tar to hex_erl_tar for zip bomb protection
  • Limits cumulative extracted size and pre-checks compressed binary inflation via zlib:safeInflate/2
  • Wire up tarball_max_uncompressed_size and docs_tarball_max_uncompressed_size config options during unpack/3 and unpack_docs/3

ericmj added 2 commits March 9, 2026 20:08
Backport {max_size, N} option from OTP's erl_tar to hex_erl_tar for zip
bomb protection. The option limits cumulative extracted size and
pre-checks compressed binary inflation.

Wire up tarball_max_uncompressed_size and docs_tarball_max_uncompressed_size
config options during unpack to enforce limits on inner tarball extraction.
@ericmj ericmj merged commit 4383e1b into main Mar 9, 2026
10 checks passed
@ericmj ericmj deleted the ericmj/max-size-unpack branch March 9, 2026 19:39
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.

1 participant