FS#22991 - Protect users against zip bombs.
Attached to Project:
AUR web interface
Opened by Loui Chang (louipc) - Monday, 21 February 2011, 16:11 GMT
Last edited by Lukas Fleischer (lfleischer) - Wednesday, 09 March 2011, 17:13 GMT
Opened by Loui Chang (louipc) - Monday, 21 February 2011, 16:11 GMT
Last edited by Lukas Fleischer (lfleischer) - Wednesday, 09 March 2011, 17:13 GMT
|
Details
Use xz -l or gunzip -l functionality to reject packages over
a certain configurable size.
|
This task depends upon
Closed by Lukas Fleischer (lfleischer)
Wednesday, 09 March 2011, 17:13 GMT
Reason for closing: Implemented
Additional comments about closing: Implemented in 1.8.1.
Wednesday, 09 March 2011, 17:13 GMT
Reason for closing: Implemented
Additional comments about closing: Implemented in 1.8.1.
That means our check will be easy to bypass by just using source files with a total size of 2^32 * m + n (m being a natural number and n being very small).
* Uncompressed size zero.
* Compressed size significantly larger than uncompressed size.
* Compression ratio less than or equal to zero.
I also traversed the whole incoming package directory of our official AUR setup and there isn't a single tarball that's bigger than 2MiB, so that should be fine.
"dd if=/dev/zero bs=1048576 count=4100 of=foo; gzip foo"
gives:
compressed uncompressed ratio uncompressed_name
4172243 4194304 0.5% foo
We have a 4MB compressed archive with an apparent uncompressed size slightly larger and thus a compression ratio above zero.
[1] http://projects.archlinux.org/aur.git/commit/?id=09d8128f99c2edc27dd81efc63e9b3c797603ca1