clt60
clt60

Reputation: 63972

How to use Archive::Extract safely - againist zip bomb or similar?

Problem outline:

From the manual

Archive::Extract can use either pure perl modules or command line programs under the hood. Some of the pure perl modules (like Archive::Tar and Compress::unLZMA) take the entire contents of the archive into memory, which may not be feasible on your system. Consider setting the global variable $Archive::Extract::PREFER_BIN to 1 , which will prefer the use of command line programs and won't consume so much memory.

The questions are:

Upvotes: 3

Views: 2149

Answers (1)

Miguel Prz
Miguel Prz

Reputation: 13792

$Archive::Extract::PREFER_BIN = 1 doesn't protect you against zip bombs, you are passing the problem to the binary unzip tool of your system.

This SO question may helps you. I like the idea of running a second process with ulimit.

Upvotes: 3

Related Questions