Once you understand a format well enough, handcrafting files within that format can often let you do things beyond what the people who wrote the format ever expected.

For example, here is a small ZIP file, containing no executable code, no viruses, no dangerous data of any sort. It’s a mere 42 kilobytes – smaller than my avatar image. The tricky bit is that, when fully uncompressed, the result is 4.5 petabytes of data. That’s right – not mega-, giga-, or even tera-bytes, but peta-bytes. (Source)

For a more extreme example, here is a teensy little zip file, a mere 440 bytes. When that file is uncompressed, the result is, within a new subdirectory, a teensy little zip file, a mere 440 bytes. When that file is uncompressed, the result is, within a new subdirectory, a teensy little zip file, a mere 440 bytes. When that file is uncompressed, the result is, within a new subdirectory, a teensy little zip file, a mere 440 bytes. … And so on. That’s right – attempting to fully uncompress all layers of this little gem results in an /infinite/ series of files. (Source)

Be quite cautious if you actually download these files. Some versions of virus scanner programs attempt to decompress archived programs completely in order to scan them; at least one server version of McAfee virus is known to be vulnerable to this, and will fill up its disc, crashing its system. Imagine that: one of the most popular, well-known, and carefully crafted pieces of software in the world… taken down by 440 bytes that fall entirely within the legal specs of the ZIP format.

Leave a Reply