daml/libs_python/BUILD.bazel
Stefano Baghino 540f3625b0
Ensure DarReader prevents zip bombs (#4703)
* Ensure DarReader prevents zip bombs

CHANGELOG_BEGIN
[DAML-LF] The DarReader has a 1GB hard cap on ZIP archive entry size to prevent zip bombs
CHANGELOG_END

* Properly test UniversalArchiveReader, make it prevent bombs, break away memory heavy tests

* Exclude the zip bomb detection test from running on Mac CI nodes
2020-02-26 13:09:58 +01:00

19 lines
493 B
Python

# Copyright (c) 2020 The DAML Authors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
py_binary(
name = "zipbomb",
srcs = ["zipbomb.py"],
visibility = ["//:__subpackages__"],
deps = [],
)
# To be used _exclusively_ for testing
genrule(
name = "zblg",
outs = ["zblg.zip"],
cmd = "$(execpath :zipbomb) --mode=quoted_overlap --num-files=65534 --max-uncompressed-size=4292788525 > $@",
tools = [":zipbomb"],
visibility = ["//:__subpackages__"],
)