Story Details

  • I use zip bombs to protect my server

    Posted: 2025-04-28 22:28:56

    The author describes using a "zip bomb" detection system to protect their server from denial-of-service attacks. Rather than blocking all zip files, they've implemented a system that checks uploaded zip archives for excessively high compression ratios, a hallmark of zip bombs designed to overwhelm systems by decompressing into massive amounts of data. If a suspicious zip is detected, it's quarantined for manual review, allowing legitimate large zip files to still be processed while preventing malicious ones from disrupting the server. This approach offers a compromise between outright banning zips and leaving the server vulnerable.

    Summary of Comments ( 384 )
    https://news.ycombinator.com/item?id=43826798

    Hacker News users discussed various aspects of zip bomb protection. Some questioned the practicality and effectiveness of using zip bombs defensively, suggesting alternative methods like resource limits and input validation are more robust. Others debated the ethics and legality of such a defense, with concerns about potential harm to legitimate users or scanners. Several commenters highlighted the "Streisand effect" – that publicizing this technique might attract unwanted attention and testing. There was also discussion of specific tools and techniques for decompression, emphasizing the importance of security-focused libraries and cautious handling of compressed data. Some users shared anecdotal experiences of encountering zip bombs in the wild, reinforcing the need for appropriate safeguards.