Skip to content

[security] "zip bomb" protection? #727

Answered by klauspost
lquerel asked this question in Q&A
Discussion options

You must be logged in to vote

WithDecoderMaxMemory or WithDecodeAllCapLimit and supply a destination buffer with the capacity you don't want to exceed.

For streams you can set WithDecoderMaxWindow, if 512MB per decode is a problem. This encoder will not automatically select any window size bigger than 32MB (with SpeedBestCompression), but other implementations may have different limits.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lquerel
Comment options

Answer selected by klauspost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #726 on January 04, 2023 11:38.