Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protection against zip bombs #87

Closed
casey opened this issue Jan 14, 2023 · 1 comment
Closed

Protection against zip bombs #87

casey opened this issue Jan 14, 2023 · 1 comment

Comments

@casey
Copy link

casey commented Jan 14, 2023

Can untrusted inputs be decompressed without using unbounded memory?

@danielrh
Copy link
Collaborator

You can employ 2 tactics:
a) You can specify a custom allocator that will not return inputs beyond a certain size.
b) You can instantiate a reader and choose to only read a certain number of bytes from the input and bound the resource usage that way.

I believe it should not use more than a fixed size based on the window size, but you can ensure that using (a)
And since the reader or writer interfaces only use bounded buffers you can either stop when your output is full or keep streaming 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

No branches or pull requests

2 participants