News for hackers. Stuff that matters.
Re:I Use Zip Bombs to Protect My Server by layer8 on Tuesday April 29, 2025 @04:36PM (#43837752)
Back when I was a stupid kid, I once did

    ln -s /dev/zero index.html
on my home page as a joke. Browsers at the time didn’t like that, they basically froze, sometimes taking the client system down with them.

Later on, browsers started to check for actual content I think, and would abort such requests.

Re:I Use Zip Bombs to Protect My Server by bobmcnamara on Tuesday April 29, 2025 @07:59PM (#43839532)
I made a 64kx64k JPEG once by feeding the encoder the same line of macro blocks until it produce the entire image.

Years later I was finally able to open it.

Re:I Use Zip Bombs to Protect My Server by opan on Tuesday April 29, 2025 @08:09PM (#43839614)
I had a ton of trouble opening a 10MB or so png a few weeks back. It was stitched together screenshots forming a map of some areas in a game, so it was quite large. Some stuff refused to open it at all as if the file was invalid, some would hang for minutes, some opened blurry. My first semi-success was Fossify Gallery on my phone from F-Droid. If I let it chug a bit, it'd show a blurry image, a while longer it'd focus. Then I'd try to zoom or pan and it'd blur for ages again. I guess it was aggressively lazy-loading. What worked in the end was GIMP. I had the thought that the image was probably made in an editor, so surely an editor could open it. The catch is that it took like 8GB of RAM, but then I could see clearly, zoom, and pan all I wanted. It made me wonder why there's not an image viewer that's just the viewer part of GIMP or something.

Among things that didn't work were qutebrowser, icecat, nsxiv, feh, imv, mpv. I did worry at first the file was corrupt, I was redownloading it, comparing hashes with a friend, etc. Makes for an interesting benchmark, I guess.

For others curious, here's the file: https://0x0.st/82Ap.png

I'd say just curl/wget it, don't expect it to load in a browser.

Re:I Use Zip Bombs to Protect My Server by Scaevolus on Tuesday April 29, 2025 @08:32PM (#43839793)
That's a 36,000x20,000 PNG, 720 megapixels. Many decoders explicitly limit the maximum image area they'll handle, under the reasonable assumption that it will exceed available RAM and take too long, and assume the file was crafted maliciously or by mistake.
Re:I Use Zip Bombs to Protect My Server by quickaccount on Tuesday April 29, 2025 @08:44PM (#43839890)
Safari on my MacBook Air opened it fine, though it took about four seconds. Zooming works fine as well. It does take ~3GB of memory according to Activity Monitor.
Re:I Use Zip Bombs to Protect My Server by bugfix on Tuesday April 29, 2025 @08:54PM (#43839969)
IrfanView was able to load it in about 8 seconds (Ryzen 7 5800x) using 2.8GB of RAM, but zooming/panning is quite slow (~500ms per action)
Re:I Use Zip Bombs to Protect My Server by hdjrudni on Tuesday April 29, 2025 @11:21PM (#43840939)
IrfanView on my PC is very fast. Zoomed to 100% I can pan around no problem. Is it using CPU or GPU? I've got an 11900K CPU and RTX 3090.
Re:I Use Zip Bombs to Protect My Server by ChoGGi on Wednesday April 30, 2025 @09:38AM (#43845073)
There's fast and slow resample viewing options in Irfanview, he may have slow turned on for higher quality.
Re:I Use Zip Bombs to Protect My Server by beeslol on Tuesday April 29, 2025 @09:05PM (#43840063)
For what it's worth, this loaded (slowly) in Firefox on Windows for me (but zooming was blurry), and the default Photos viewer opened it no problem with smooth zooming and panning.
Re:I Use Zip Bombs to Protect My Server by virtue3 on Tuesday April 29, 2025 @09:34PM (#43840255)
I use honey view for reading comics etc. It can handle this.

Old school acdsee would have been fine too.

I think it's all the pixel processing on the modern image viewers (or they're just using system web views that isn't 100% just a straight render).

I suspect that the more native renderers are doing some extra magic here. Or just being significantly more OK with using up all your ram.

Re:I Use Zip Bombs to Protect My Server by glial on Tuesday April 29, 2025 @09:37PM (#43840275)
It loads in about 10 seconds in Safari on an M1 Air. I think I am spoiled.
Re:I Use Zip Bombs to Protect My Server by MaysonL on Tuesday April 29, 2025 @10:14PM (#43840488)
It loaded after 10-15 seconds on myiPad Pro M1, although it did start reloading after I looked around in it.
Re:I Use Zip Bombs to Protect My Server by radeeyate on Tuesday April 29, 2025 @10:37PM (#43840649)
Interestingly enough, it loads in about 5 seconds on my Pixel 6a.
Re:I Use Zip Bombs to Protect My Server by lgeek on Tuesday April 29, 2025 @10:39PM (#43840659)
On Firefox on Android on my pretty old phone, a blurry preview rendered in about 10 seconds, and it was fully rendered in 20 something seconds. Smooth panning and zooming the entire time
Re:I Use Zip Bombs to Protect My Server by connicpu on Wednesday April 30, 2025 @01:57AM (#43841694)
Firefox on a Samsung S23 Ultra did it a few seconds faster but otherwise the same experience
Re:I Use Zip Bombs to Protect My Server by fennecbutt on Saturday May 03, 2025 @11:19AM (#43879639)
Following up with Firefox on S24 Ultra loaded from blank to image in a second and then could zoom right in fine with no blurriness or stuttering at all!
Re:I Use Zip Bombs to Protect My Server by Moosdijk on Tuesday April 29, 2025 @11:21PM (#43840944)
It loads in about 5 seconds on an iPhone 12 using safari.

It also pans and zooms swiftly

Re:I Use Zip Bombs to Protect My Server by close04 on Wednesday April 30, 2025 @04:24AM (#43842532)
How strange, took at least 30s to load on my iPhone 12 Pro Max with Safari but it was smooth to pan and zoom after. Which is way better than my 16 core 64GB RAM Windows machine where both Chrome and Edge gave up very quickly, with a "broken thumbnail" icon.
Re:I Use Zip Bombs to Protect My Server by GTP on Wednesday April 30, 2025 @06:44AM (#43843341)
Probably because they're based on the same engine.
Re:I Use Zip Bombs to Protect My Server by close04 on Wednesday April 30, 2025 @10:06AM (#43845460)
The strangeness was that 2 iPhones from the same generation would exhibit such different performance behaviors, and in parallel the irony that a desktop browser (engine irrelevant) on a device with cutting edge performance can't do what a phone does.
Re:I Use Zip Bombs to Protect My Server by avianlyric on Wednesday April 30, 2025 @06:43AM (#43843335)
Same, right up until I zoomed in and waited for Safari to produce a higher resolution render.

Partially zoomed in was fine, but zooming to maximum fidelity resulted in the tab crashing (it was completely responsive until the crash). Looks like Safari does some pretty smart progressive rendering, but forcing it to render the image at full resolution (by zooming in) causes the render to get OOMed or similar.

Re:I Use Zip Bombs to Protect My Server by mikaraento on Wednesday April 30, 2025 @01:19PM (#43848223)
I remember that years ago (mobile) Safari would aggressively use GPU layers and crash if you ran out of GPU memory. Maybe that's still happening?

Preview on a mac handles the file fine.

Re:I Use Zip Bombs to Protect My Server by promiseofbeans on Wednesday April 30, 2025 @12:22AM (#43841236)
Firefox on a mid-tier Samsung and a cheapo data connection (4G) took avout 30s to load. I could pan, but it limited me from zooming much, and the little I could zoom in looked quite blury.
Re:I Use Zip Bombs to Protect My Server by jaeckel on Wednesday April 30, 2025 @01:20AM (#43841529)
ImgurViewer from fdroid on an FP5 opened it blurry after around 5s and 5s later it was rendered completely.

Pan&zoom works instantly with a blurry preview and then takes another 5-10s to render completely.

Re:I Use Zip Bombs to Protect My Server by sixtyj on Wednesday April 30, 2025 @01:54AM (#43841681)
PDF files with included vector-based layers, e.g. plans or maps of large area, are also quite difficult to render/open.
Re:I Use Zip Bombs to Protect My Server by jve on Wednesday April 30, 2025 @09:01AM (#43844633)
Just today collegue was looking at some air traffic permit map within PDF that was like 12MB or something around that. Complained about Adobe Reader changing something so he cannot pan/zoom no more.

I suggested to try the HN beloved Sumatra PDF. Ugh, it couldn't cope with it normally. Chrome did it better coped better.

Re:I Use Zip Bombs to Protect My Server by DiggyJohnson on Wednesday April 30, 2025 @02:18AM (#43841825)
Safari on iPhone did a good job with it actually lol
Re:I Use Zip Bombs to Protect My Server by spockz on Wednesday April 30, 2025 @02:46AM (#43841968)
Loading this on my iPhone on 1gbit took about 5s and I can easily pan and zoom. A desktop should handle it beautifully.
Re:I Use Zip Bombs to Protect My Server by arc-in-space on Wednesday April 30, 2025 @03:33AM (#43842222)
Oh hey it's the thing that ruins an otherwise okay rhythm game.
Re:I Use Zip Bombs to Protect My Server by ninalanyon on Wednesday April 30, 2025 @03:36AM (#43842244)
Opens fine in Firefox 138.
Re:I Use Zip Bombs to Protect My Server by IamDaedalus on Wednesday April 30, 2025 @03:51AM (#43842334)
on mobile Brave just displayed it as the placeholder broken link image but in Firefox it loaded in about 10s
Re:I Use Zip Bombs to Protect My Server by Meneth on Wednesday April 30, 2025 @08:39AM (#43844354)
On my Waterfox 6.5.6, it opened but remained blurry when zoomed in. MS Paint refused to open it. The GIMP v2.99.18 crashed and took my display driver with it. Windows 10 Photo Viewer surprisingly managed to open it and keep it sharp when zoomed in. The GIMP v3.0.2 (latest version at the time of writing) crashed.
Re:I Use Zip Bombs to Protect My Server by swiftcoder on Wednesday April 30, 2025 @11:54AM (#43846976)
> don't expect it to load in a browser

Takes a few seconds, but otherwise seems pretty ok in desktop Safari. Preview.app also handles it fine (albeit does allocate an extra ~1-2GB of RAM)

Re:I Use Zip Bombs to Protect My Server by jsnider3 on Wednesday April 30, 2025 @12:13PM (#43847262)
I get a Your connection was interrupted on Chrome.
Re:I Use Zip Bombs to Protect My Server by tristor on Wednesday April 30, 2025 @03:14PM (#43849504)
Loads fine and fairly quickly on a Macbook Pro M3 Pro with Firefox 137. Does have a bit of delay when initially zooming in, but pans and zooms fine after.
Re:I Use Zip Bombs to Protect My Server by johannesrexx on Wednesday April 30, 2025 @08:00PM (#43852107)
qView opens this easily enough.
Re:I Use Zip Bombs to Protect My Server by hultner on Monday May 05, 2025 @05:20PM (#43899563)
Works fine on my 5 year old iPad Pro with an A12 processor.
Re:I Use Zip Bombs to Protect My Server by ack_complete on Tuesday April 29, 2025 @09:26PM (#43840198)
I once encoded an entire TV OP into a multi-megabyte animated cursor (.ani) file.

Surprisingly, Windows 95 didn't die trying to load it, but quite a lot of operations in the system took noticeably longer than they normally did.

Re:I Use Zip Bombs to Protect My Server by koolba on Tuesday April 29, 2025 @05:21PM (#43838166)
I hope you weren’t paying for bandwidth by the KiB.
Re:I Use Zip Bombs to Protect My Server by santoshalper on Tuesday April 29, 2025 @06:48PM (#43838963)
Nah, back then we paid for bandwidth by the kb.
Re:I Use Zip Bombs to Protect My Server by slicktux on Tuesday April 29, 2025 @07:59PM (#43839534)
That’s even worse! :)
Re:I Use Zip Bombs to Protect My Server by m463 on Tuesday April 29, 2025 @06:58PM (#43839051)
Sounds like the favicon.ico that would crash the browser.

I think this was it:

https://freedomhacker.net/annoying-favicon-crash-bug-firefox...

Re:I Use Zip Bombs to Protect My Server by dolmen on Wednesday April 30, 2025 @01:05AM (#43841455)
Looks like something I should add for my web APIs which are to be queried only by clients aware of the API specification.
Re:I Use Zip Bombs to Protect My Server by sandworm101 on Tuesday April 29, 2025 @05:45PM (#43838403)
Devide by zero happens to everyone eventually.

https://medium.com/@bishr_tabbaa/when-smart-ships-divide-by-...

"On 21 September 1997, the USS Yorktown halted for almost three hours during training maneuvers off the coast of Cape Charles, Virginia due to a divide-by-zero error in a database application that propagated throughout the ship’s control systems."

" technician tried to digitally calibrate and reset the fuel valve by entering a 0 value for one of the valve’s component properties into the SMCS Remote Database Manager (RDM)"

Re:I Use Zip Bombs to Protect My Server by astolarz on Tuesday April 29, 2025 @07:29PM (#43839308)
Bad bot
Re:I Use Zip Bombs to Protect My Server by fuzztester on Tuesday April 29, 2025 @07:59PM (#43839542)
I remember reading about that some years ago. It involved Windows NT.

https://www.google.com/search?q=windows+nt+bug+affects+ship

Re:I Use Zip Bombs to Protect My Server by M95D on Wednesday April 30, 2025 @03:37AM (#43842249)
I wonder if I could create a 500TB html file with proper headers on a squashfs, an endless <div><div><div>... with no closing tags, and if I could instruct the server to not report file size before download.

Any ideeas?

Re:I Use Zip Bombs to Protect My Server by CobrastanJorji on Wednesday April 30, 2025 @03:44AM (#43842300)
Yes, servers can respond without specifying the size by using chunked encoding. And you can do the rest with a custom web server that just handles request by returning "<div>" in a loop. I have no idea if browsers are vulnerable to such a thing.
Re:I Use Zip Bombs to Protect My Server by M95D on Wednesday April 30, 2025 @04:05AM (#43842424)
I would make it an invisible link from the main page (hidden behind a logo or something). Users won't click it, but bots will.
Re:I Use Zip Bombs to Protect My Server by stefs on Wednesday April 30, 2025 @05:05AM (#43842790)
the problem with this is that for a tarpit, you just don't want to make it expensive for bots, you also want to make it cheap for yourself. this isn't cheap for you. a zip bomb is.
Re:I Use Zip Bombs to Protect My Server by ku1ik on Thursday May 01, 2025 @04:29AM (#43855010)
Right, so an invisible link + a zipbomb is da bomb.
Re:I Use Zip Bombs to Protect My Server by stefs on Friday May 02, 2025 @06:12AM (#43867972)
maybe, maybe not. it's one tool at your disposal. it's easy to guard against zip bombs if you know about them - the question is, how thorough are the bot devs you're targeting?

there are other techniques. for example: hold a connection open and only push out a few bytes every few seconds - whether that's cheap for you or not depends on your servers concurrency model (if it's 1 OS thread per connection, then you'd DOS yourself with this - but with an evented model you should be good). if the bot analyzes images or pdfs you could try toxic files that exploit known weaknesses which lead to memory corruption to crash them; depends on the bots capabilities and used libraries of course.

Re:I Use Zip Bombs to Protect My Server by konata390 on Wednesday April 30, 2025 @04:25AM (#43842545)
I just tested it via a small python script sending divs at a rate of ~900mb (as measured by curl) and firefox just kills the request after 1-2 gb received (~2 seconds) with an "out of memory" error, while chrome seems to only receive around 1mb/s, uses 1 cpu core 100%, and grows infinitely in memory use. I killed it after 3 mins and consuming ca. 6GB (additionally, on top of the memory it used at startup)
Re:I Use Zip Bombs to Protect My Server by M95D on Wednesday April 30, 2025 @05:09AM (#43842810)
What did the bots do?
Re:I Use Zip Bombs to Protect My Server by Ugohcet on Wednesday April 30, 2025 @05:38AM (#43842956)
Why use squashfs when you can do the same OP did and serve a compressed version, so that the client is overwhelmed by both the uncompression and the DOM depth:

yes "<div>"|dd bs=1M count=10240 iflag=fullblock|gzip | pv > zipdiv.gz

Resulting file is about 15 mib long and uncompresses into a 10 gib monstrosity containing 1789569706 unclosed nested divs

Re:I Use Zip Bombs to Protect My Server by M95D on Wednesday April 30, 2025 @08:04AM (#43844017)
I like it. :)
Re:I Use Zip Bombs to Protect My Server by sroussey on Wednesday April 30, 2025 @11:45AM (#43846847)
You can also just use code to endlessly serve up something.

Also you can reverse many DoD vectors depending on how you are setup and costs. For example reverse Slowloris attack and use up their connections.

Re:I Use Zip Bombs to Protect My Server by imron on Thursday May 01, 2025 @06:44AM (#43855954)
This is beautiful
Re:I Use Zip Bombs to Protect My Server by AStonesThrow on Wednesday April 30, 2025 @04:08AM (#43842444)
[delayed]
Re:I Use Zip Bombs to Protect My Server by vidarh on Wednesday April 30, 2025 @05:08AM (#43842806)
You yourself explain how it could've worked: Plenty of webservers are or were not chroot'ed.
Re:I Use Zip Bombs to Protect My Server by pandemic_region on Wednesday April 30, 2025 @07:03AM (#43843500)
Which means that if your bot is getting slammed by this, you can assume it's not chrooted and hence a more likely target for attack.
Re:I Use Zip Bombs to Protect My Server by vidarh on Wednesday April 30, 2025 @12:34PM (#43847603)
This does not logically follow. If your bot is getting slammed by a page returning all zeros (what the person I replied to reacted to), all you know is something on the server is returning a neverending stream of zeros. A symlink to /dev/zero is an easy way of doing that, but knowing the server is serving up a neverending stream of zeros by no means tells you whether the server is running in a decently isolated environment or not.

Even if you knew it was done with a symlink you don't know that - these days odds are it'd run in a container or vm, and so having access to /dev/zero means very little.

Re:I Use Zip Bombs to Protect My Server by M95D on Wednesday April 30, 2025 @04:25AM (#43842539)
Could server-side includes be used for a html bomb?

Write an ordinary static html page and fill a <p> with infinite random data using <!--#include file="/dev/random"-->.

or would that crash the server?

Re:I Use Zip Bombs to Protect My Server by GTP on Wednesday April 30, 2025 @06:50AM (#43843392)
I guess it depends on the server's implementation. but, since you need some logic to decide when to serve the html bomb anyway, I don't see why you would prefer this solution. Just use whatever script you're using to detect the bots to serve the bomb.
Re:I Use Zip Bombs to Protect My Server by M95D on Wednesday April 30, 2025 @08:02AM (#43844000)
No other scripts. Hide the link to the bomb behind an image so humans can't click it.
Re:I Use Zip Bombs to Protect My Server by scoodah on Thursday May 01, 2025 @02:22AM (#43854265)
My first thought is how this would interact with things like screen readers and other accessibility devices
Re:I Use Zip Bombs to Protect My Server by ku1ik on Thursday May 01, 2025 @04:31AM (#43855022)
Don’t screen readers ignore invisible text/links?
Re:I Use Zip Bombs to Protect My Server by amelius on Wednesday April 30, 2025 @04:35AM (#43842595)
Maybe it's time for a /dev/zipbomb device.
Re:I Use Zip Bombs to Protect My Server by GTP on Wednesday April 30, 2025 @06:52AM (#43843410)
ln -s /dev/urandom /dev/zipbomb && echo 'Boom!'

Ok, not a real zip bomb, for that we would need a kernel module.

Re:I Use Zip Bombs to Protect My Server by Dwedit on Wednesday April 30, 2025 @11:29AM (#43846622)
That costs you a lot of bandwidth, defeating the whole point of a zip bomb.
Re:I Use Zip Bombs to Protect My Server by wfn on Wednesday April 30, 2025 @09:52PM (#43852909)
> Ok, not a real zip bomb, for that we would need a kernel module.

Or a userland fusefs program, nice funky idea actually (with configurable dynamic filenames, e.g. `mnt/10GiB_zeropattern.zip`...

Re:I Use Zip Bombs to Protect My Server by ompogUe on Saturday May 03, 2025 @03:19PM (#43881390)
we discovered back when IE3 came out that you could crash windows by leaving off a table closing tag.