Re:Upload2Shell · CVE-2026-125396
by g-b-r on Saturday November 21, 2026 @06:08PM
(#50594550)
Hopefully few people install Ghostscript if they don't need it, on a server that processes user uploads
[ Parent
| on HN ]
Re:Upload2Shell · CVE-2026-125396
by WesolyKubeczek on Saturday November 21, 2026 @06:33PM
(#50594709)
You install ImageMagick, it most likely depends on Ghostscript.
You use something else than ImageMagick, say, to resize an uploaded image, and the moment it sees a color-managed image, it will produce something that looks like puke.
I had to do a very custom build of ImageMagick to get rid of dependencies on libgs and libX11. It wasn't fun.
Yeah, sadly true
ImageMagick was problematic for so long by pulling everything and the kitchen sink as dependencies. It's just not something you'd like to replace because it's got nice features and... works. It feels absurd but right now, if you have a very narrow use case (like just resizing), it may be better to make an LLM create an alternative, in a safer language, with validated core components, tested on a large number of samples.
Something that uses CImg just for resizing could be a decent alternative. It’s a library but they provided a nice cli for it the last time i checked
Yes, it seems much smaller than ImageMagick.
ImageMagick has a big attack surface, when most people probably use it just for cropping and resizing.
Just use something leaner, when you can.
Re:Upload2Shell · CVE-2026-125396
by WesolyKubeczek on Sunday November 22, 2026 @06:55AM
(#50598790)
„When you can” is doing the heavy lifting here. Also, sometimes you need to process PostScript-adjacent things.
Another alternative is GraphicsMagick (https://www.graphicsmagick.org/) which aims to be API and utility compatible with ImageMagick, but spends most of its development effort on fuzzing, verification, etc. It's a more secure alternative to ImageMagick for those who've developed something significant that depends on ImageMagick.
I was looking through the PPDs a Brother printer installed for Linux, it had a pre-built ghostscript binary in there that hadn't been updated in god knows how long. I wonder if printing a PDF with an embedded font or something could trigger that.