Hi Tika developers, The Commons PMC is drafting a threat model for Commons Compress:
https://github.com/apache/commons-compress/pull/854 Tika is one of the main consumers of Compress, and it parses untrusted archives all the time, so we would very much like your review before we settle on it. In short, the draft proposes that: - Only some formats are covered for untrusted input: AR, CPIO, 7z, TAR, ZIP/JAR/APK and all compressors except Pack200. ARJ, DUMP, LHA and Pack200 are for trusted input only. - For covered formats, Compress allocates memory only for data that is actually present, respects the configured memory limits (7z, LZMA, XZ, Z), and always makes progress (no infinite loops). - Compress does not limit the decompressed output. It streams the output and gives the caller the means to stop (InputStreamStatistics, memory limits). Bounding the output, and the depth of nested archives, is the caller's job. The last point is the one where we most need to agree on who does what. As we understand it, Tika already guards against zip bombs on its side. Does the split above match how Tika uses Compress? In particular: 1. Does Tika rely on Compress for any protection that the draft does not promise? 2. Are there guarantees in the draft that Tika does not need? Each guarantee we give can lead to a CVE that you then have to triage, so fewer guarantees can be better for you too. Comments on the PR or on this list are both welcome. Thanks, Piotr
