hashicorp / go-getter

Package for downloading things from a string URL using a variety of protocols.
Mozilla Public License 2.0
1.62k stars 226 forks source link

Add decompression bomb mitigation options for v1 #412

Closed picatz closed 1 year ago

picatz commented 1 year ago

This PR aims to fix #407 (reserved as CVE-2023-0475), by introducing "(de)compression" bomb mitigation options to the various decompressors provided by this package. Specifically, FileSizeLimit and FilesLimit.

There are a few downsides to consider with the current approach I've taken before we merge this PR:

☝️ To mitigate some of those issues, for the ZIP and TAR archives, I use the FileInfo in the header returned for the content to check the size before using it.