Log4Shell was bad, but it lived in a 3rd party library feature (JNDI lookups) that you could disable or strip out while you patched. PHP2Shell sits in the PHP runtime itself and the only effective fix is to update PHP
I still did not get how this was ever a big issue to begin with. If your LDAP can inject bad code, this of course is not great, but if an attacker has already access to your LDAP, aren't you screwed a lot more already?
Attacker sends request with some specially crafted payload in a field they know will be logged (e.g. because it's invalid)
Targeted server logs the invalid value
Logging framework looks at the payload and sees a macro to expand
The macro contains a reference to a JNDI value including a remote server address to get the value from.
The JNDI server (which can be any server on the internet) returns a value that is actually a serialized Java object including bytecode for that object's class
Targeted server deserializes the object and while doing so executes code in the constructor (which was supplied by the attacker).
I'm still always astounded by what these hackers can do. We have the API with docs, a dev environment and privileged access, and we still can't make these damn machines do what we want.
In the case of Log4Shell, the exploit wasn't even difficult.
And the vulnerability actually arose exactly from "making these damn machines do what we want" - IIRC one guy thought it would be a useful feature to have log4j support inserting JNDI values in its macros, and got it implemented. Another guy, at another time, thought it would be useful for JNDI to be able to look up stuff from a remote server, and got it implemented. Yet another guy, at another time, thought it would be useful for JNDI values to contain serialized classes including their bytecode, and got it implemented.
And nobody ever saw the big picture, what these three things combined made possible.
If your logging library doesn't support pulling and executing an entire codebase from an LDAP server via a formatting string interpolation, what is it even doing for you?
Aside from supply chain attacks when a library developer's credentials got stolen, all of the Rust CVEs so far have been "this function accidentally allows you to cause a segfault in a nonexisting edge case if you really tried to make it not work."
The latest one makes it so that references' lifetime can be extended past the referee's lifetime if a destructor copies it to a global variable but since no one writes that kind of spaghetti it went unnoticed for 11 years.
Which I think makes sense given the language would otherwise provide a false sense of security around use-after-free and other memory-related bugs that other languages can offload onto "skill issue".
To be fair if something like this affected ex. Boost no sane C++ dev would claim it was just a library. Log4j was not a library it was THE library for Java logging. If a library is very widely used whenever it is in the standard library or not is almost irrelevant.
I'm confident it will eventually, just given the law of large numbers and the baseline bug rate of all written code. All it takes is for a big library to use a small bit of unsafe incorrectly, a bug in the compiler that drops a check (this actually happened recently), a DLL that does something unexpected / undocumented, etc.
One thing to remember is that the PHP issue wasn't in the language, it was in the VM/runtime implementation. That implies that no matter how safe the language is from a design perspective, it can still cause issues due to how it interacts with the OS and hardware. Rust has been implemented for VMs such as WebASM. That means all that's remaining is some exploit in the WASM runtime, and a Rust WASM library that generates code in such a manner to expose the vector.
Did Rust ever have a high profile backend usage to get into a situation to have one?
I mean, I do love rust but it's not primarily used as a typical web backend language to be in a position of "high target" and "connected to every other machine over the internet".
Oh yes definitely! Rust is used in servers by Oxide computing, in cars by Volvo Cars, and a bunch of other infrastructure like parts of Cloudflare (which has a really nice post-mortem on some Rust code causing them problems, which was due to business logic and not the language itself).
Check out Rust In Production podcast if you want to hear some real-life stories about Rust out there in the world :)
Edit: ah and forgot to mention: it is a certified safety-critical language for industrial and automotive applications thanks to Ferrocene. So I’d say that’s high profile _enough_
One of our PMs was ecstatic last night when he realised one of our VERY outdated read-only systems was on 3. something and technically didn't have the exploit introduced yet!
Wasn't long until one of the devs pointed out it's probably in trouble due to a fuck load of other exploits and they piped down. But yeah, companies as always are running v outdated shit.
We hope and pray Paul’s local never gets nuked and that's not even a joke. One senior dev holds the keys, tale as old as time.
From what I know it's barely maintained, fully out of support. TBF our customer barely uses it but they pay us a lot of cash to keep it as a read only reference tool so we go along with it. Apparently the solution last night was to stick a forced vpn connection requirement until they realised that probably won't work properly with v3 so they've put a WAF in front of it.
To be fair this exploit in question didn't care about if the PHP version was ancient or modern.
And while you definitely shouldn't expose such old PHP versions to the internet (and Ideally don't run it at all), even these tend to be quite secure, without any significant know security flaws. And even for these ancient versions you can now get patched versions, just not from the PHP core developers.
One of the project I am responsible for (maintain/add new features when needed) is in php 5.2. Thank God it is hosted on premises and can only be accessed via corporate network.
The local network is not a security barrier though. An attacker could e.g. gain access to another internal system and then move laterally to your PHP system and execute code there.
I am talking generally, not just about this vulnerability. WordPress has an issue? PHP is condemned. A developer built an insecure system that gets hacked? PHP is to blame.
Sometimes we have to separate the programming language from the developer.
For these two vulnerabilities, yes, the language and how it was built are to blame, and the concern is proportional.
But for many other instances to do with how developers use the tool and what they build with it, it is not.
I don't think so. If you look at the number of shared hosting servers running PHP because of WordPress, you can start to imagine the scale of the PHP vulnerability.
Almost every web host provider I know has some shared server/CPanel arrangement and a WordPress thing going on. Now imagine Drupal, Joomla, custom PHP installs, (part of) Facebook, CNN, the National Geographic, numerous government agencies, hospitals, internal systems, and many others that run on WordPress or PHP, and you can see why this is so significant and why people are freaking out.
If the FBI and NSA come out to say the vulnerabilities are significant, you better know they are.
I get what you are saying. If you are looking at it from the client site, there is no argument; such a vulnerability would be devastating for JS.
But that is not what we are talking about. PHP does not run on the client, as far as I know, so you can't compare it to JS running client-side. Compare it to JS that runs on servers, and then see how those numbers stack up.
Hence it's properly sandboxed, and running on the client means that it by definition can't directly access anyone else's data. Unlike something running on the backend where *every other users' data" is
It is weird, isn't it? I think this stems from PHP's traditionally very low bar to entry, especially back in the late 90s/early 2000s. If you wanted to build a dynamic website back then, you had options but some of them were cost prohibitive, like Visual Studio/IIS/ASP, both for development and hosting. PHP with its LAMP/WAMP stack that you could run on virtually any desktop, develop in any free text editor, and numerous low cost hosting providers let you get up and running without a huge commitment.
For a time, I worked for a company where several internal business critical apps were written in PHP following the procedural "all business logic and DB queries are in the page and dump their results out as html" that was common in early tutorials. The people who wrote those apps were not software developers by profession, but rather bioinformaticians, biologists, and geneticists who needed an application to handle some part of the laboratory process, and they just made something to do the job.
Precisely why, though. When half the internet runs on unparched php then I think it's not exactly "blowing it out of the water" when the blast radius of these attacks are so wide.
I mean, compiler bugs... exist. They are not particularly easy to hit and especially hard to exploit though.
Many type systems also have unsoundness bugs, you just have to write the code in a very special unnatural way, so they don't really ever come up in real code.
I believe this borrow checker one was the same case.
(And Im no rust fanboy, see my other comments where I'm sarcastically say that rust just never got popular enough to have this kind of vuln)
You are right and I was more poking fun than anything. It was just relevant in my mind because I'd just watched the LetsGetRusty YouTube video of it. This one was extremely obscure and requires a custom impl of a trait that is auto generated for you.
I think that compilers have very few bugs compared to their complexity level and the developers that write them do phenomenal work.
Don't forget about the double reference lifetime bug that is still open after a decade.
That being said "the compiler might not catch a possible segfault if you write absolutely horrendous spaghetti" is not exactly on the same level as "actively exploited RCE because you didn't correctly free a buffer and use global state for request data in a webserver."
... idk, by next year the rust compiler will fix the already obscure bug, but the C++ UB will remain UB. As someone that pays his bills with C++, I don't see it as a win.
Agreed. I like C++. I may even prefer it to Rust. I think the committee made a bad decision when they discontinued P3390. Sean Baxter was on the right track and profiles don't seem to solve the crux of the problem once you get away from simple examples.
UB means undefined behavior. In safe Rust the borrow checker guarantees there is no UB. Or at least that's the idea. It rejects some technically valid code in favor of guaranteeing that a sub set of complex code is safe.
A simple example is array like collection access. If you use [] in C++ to access out of bounds of a collection, you have UB. If you access out of bounds you could get garbage data or you might get a segfault. The compiler might assume the pointer the array access decays to is valid and make optimization decisions based on that because the compiler always assumes the programmer has not written UB code.
In safe Rust all array access is bounds checked. The compiler and the array safe api guarantees that you only access within bounds, always. It is not possible in safe Rust to write UB code using any of the array like collections.
Php isn't widely used at software shops, from what I understand. It's all the website builders and server management software on consumer facing products.
Our parent company sent all development teams of their child companies pizza to show how grateful they were for tackling the issue so well. We, being a dotnet company, were very confused, but still happy with the pizza.
The worst thing about this CVE was that our ISP's root server came with pre-installed Plesk, that was the only vulnerability that wouldn't be auto healed by the CD pipeline.
The PHP issue is in the VM/runtime/interpreter, which is something Rust doesn't have. So there can't be a vulnerability inherent in the language itself (only accidental unsoundness in the compiler). There can be vulnerabilities in the standard library, but you'd need to be using the affected functions in order to be affected by such a vulnerability. That's a pretty fundamental distinction.
I think the bigger point is, this is a memory bug. This is the kind of issue Rust and other memory safe languages can almost entirely avoid. It's the most common flaw in programs, and any language that has those issues is imo fair to criticize given how commonly these issues are found, happen, and long they exist for. Not to mention the most complicated types of bugs to avoid in manually managed systems.
Swapping isn't easy, cheap or even possible but it's pretty clear to me that the future should be built on memory safe languages.
I am a Rust fanatic though, so I am heavily biased.
PHP, Java, JavaScript etc. are memory safe languages. They are implanted implemented* using unsafe languages, though. So is Rust (LLVM and unsafe internals).
*Damn auto-correct and needing glasses when typing on the phone.
Just dont let fanaticism blind you. Had rust dev team refuse for weeks to acknowledge a memory leak in prod no matter how much proof. Basically took the fix PR WITH tests to get them to acknowledge it. especially when using 3rd party libs that use unsafe etc
I hate rust. Unfortunately I'm forced to use it at work.
I found a fun memory leak just this past week in the rust program I'm working on. It's largely not-my-code and I've been slowly fixing and rewriting it.
Rust uses glibc under the hood. When multi-threaded Rust code rapidly creates and deletes vectors, glibc hoards that freed memory in internal pools (like thread caches and arenas) rather than returning it to the Linux kernel, intending to speed up future allocations.
However, if even a single tiny, active piece of memory sits at the top of an arena, it acts as a deadbolt, trapping all the empty deleted space beneath it and causing the application's memory usage to steadily balloon over time. So every vector create and delete was causing new arenas to be allocated, while old ones were never deleted.
Under the hood, rust loves creating and allocating new vectors on the heap instead of reusing anything. C++ will often just pass around the same heap pointer for reuse. This can cause more heap fragmentation in rust vs c++. In testing with identical code blocks that rapidly create and destroy large standard vectors (std::vec and std::vector), the rust code will leak while the c++ code does not. It's frustrating.
We were leaking around 64 MB/s. I had to manually garbage collect and trim this nonsense. I also hoisted and reused the vectors, so they aren't constantly being created and destroyed and fragmenting the heap.
I'm not saying c++ is perfect and memory safe, but I've personally had more weird memory management issues and leaks with rust than I have with c++.
Edit: I also hate how many things that are standard in c++ aren't standard in rust and require using some third-party crate. With all of the supply chain attacks going on (npm, pypi, etc), it's only a matter of time before rust crates get hit. It's just a larger threat surface.
I don't worry about c++'s std:: stealing credentials and git keys, but who knows if joe blow's rust rewrite has been compromised recently.
IMO, it's not too difficult to add new features in newer languages through bindings and you can gradually depricate old code. In my experience, getting management on board is a lot harder than actually switching.
That’s not the point. Nobody is claiming other languages are immune to RCE vulnerabilities. The issue is the speed and scale of AI-assisted exploitation—and how cheap it can become. PHP is everywhere, giving attackers an enormous target base.
“Other languages have bugs too” doesn’t address that, and neither does “just keep everything updated.” You can’t assume patching will always outrun exploitation.
This argument could be applied to any widely-deployed language, framework, execution environment, or the like. The effort goes into wherever the value is; if it wasn't PHP, it'd be the next thing down the hierarchy.
Yes, and on the browser side it gets even messier: we depend on end users keeping things updated, and we all have stories about how well that goes.
On the server side, there’s at least the hope that updates get deployed faster, just as with PHP. But that’s still only a hope. The larger the installed base, the more systems there will be whose operators simply don’t update them.
Sorry, I probably wasn’t clear enough. My point isn’t about PHP, JavaScript, or any particular language. I was trying to say that getting updates deployed quickly and consistently is the real challenge. I should have said that directly.
CVE-2021-3177 is the closest I can think of but this is nowhere near comparable imo. You have to accept floating-point numbers as untrusted input, it's not like a zero days before any code even run like for PHP.
Why our memory safety guarantees and other tooling failed to catch this exploit.
Meanwhile, PHP devs think their 1 big blob of unsafe C http parsing code is normal and are deflecting about how other systems aren't perfect either.
We have half a dozen safety features that have gone mainstream in the past decade that would have prevented this bug.
Nobody expects perfection, but posting memes like this is enough to show the mindset of the average PHP dev and how far behind they are on technical merit that they do not even realize it.
Eh, I like python, but I remember the all-hands-on-deck at my company when we had to convert all of the python2 to python3 before the End-of-Life date. It was no fun.
You know I used php at some point and moved on to other things that seemed better for my task . I never really went back to it on any new project but also when I had to work on projects written in it I didn’t hate it but also didn’t love it.
Seeing this critical issue changes nothing in the way I feel. Shit happens ya know. I just hope they gave the large providers and boaters enough head start to upgrade their systems
What I am mad about is the railway incident, that shit boils by blood. I don’t use railway (nor other services I’m a do it your self and take the blame for everything kinda guy) . But that shit is absurd to let it happen and try to brush it out as so a few api keys got taken oops just rotate them.
I was about to say C has never had such problems but implementations of its standard library functions have in the past caused vulnerabilities (I'm a bit new to C so I guess I should've done that research earlier)
It's the python guys who should be having that face...
Intentionally and obnoxiously not backward compatible interpreted language that is (a) everywhere, and (b) has versions running unmaintained in production long after end of life because the code they are running isn't compatible with the current version but no one is able to 'just refactor it' like the python devs seem to think we have infinite capacity to do.....
php has a multi decade history though of it... so you know theres like a blood trail of evidence at this point. it lets developers do things they shouldnt be allowed to do.
I'd argue that most older PHP problems were either SQL injection--which isn't a language problem, but a programmer one--or from the existence of the horrible misfeature that was register_globals. The latter was removed in 5.4 (released in 2012).
Everyone’s being unfairly mean to the language that’s based around a guy making function names purposefully different lengths to workaround issues with their strlen based implementation.
I learned programming on PHP 20 years ago. I've moved to C but the main thing I remember was the error reporting was basically luxurious compared to anything else.
1.6k
u/fatrobin72 Oct 22 '26
Please ignore how significant our logging libraries vulnerabilities were a few years back.
~a dev who knows java.
242
u/pjank85 Oct 22 '26
Java had the famous logging one, JavaScript had uncountable ones, but did Rust ever had a high profile RCE?
556
u/kennedy_gitahi Oct 22 '26
Anything PHP gets blown out of proportion because of how much of the internet relies on it.
236
u/StrengthTheory Oct 22 '26
A good developer knows that all languages suck equally. Only HolyC is sacred.
36
u/Lupowan Oct 22 '26
NPM is my favourite malware vector
35
u/stupidfock Oct 22 '26
npm i @literallyavirus/latest
34
u/Asttarotina Oct 22 '26
It's Remote Code Execution only when it comes from PHP region of France.
369
u/Lachee Oct 22 '26
What do you mean? Rust is perfect in every single way and cannot do no wrong. It’s memory safe by design 🤓👆 /s
24
u/DesertBeagle Oct 22 '26
I mean, how many issues come from the language itself vs the design choices of the programmer?
40
u/ardicilliq Oct 22 '26
See? php has remote code execution problem… it’s trash…
86
u/Highborn_Hellest Oct 22 '26
Yesterday i was ask how i'm weathering the storm of the php exploit at my work.
1: i'm a software tester and who asked knows
2: we don't use php.
41
u/Drfoxthefurry Oct 22 '26
This is why I use assembly instead
8
u/CranberryDistinct941 Oct 22 '26
This week on NPM just corrupted another repo
14
u/Pares_Marchant Oct 22 '26
It makes noise because of how easy it is to exploit and the real-world effects of it (like some sites shutting down).
14
u/Character_Building Oct 22 '26
They want us to think PHP stands for Post Hypertext Processor but that name was retconned from Panic Hotfix Prayer
7
u/_indi Oct 22 '26
Some of the comments here are very likely to age like milk.
7
u/Batman_AoD Oct 24 '26
The PHP issue is in the VM/runtime/interpreter, which is something Rust doesn't have. So there can't be a vulnerability inherent in the language itself (only accidental unsoundness in the compiler). There can be vulnerabilities in the standard library, but you'd need to be using the affected functions in order to be affected by such a vulnerability. That's a pretty fundamental distinction.
6
u/SomethingAboutUsers Oct 22 '26
Reminder that all programming languages suck.
5
u/MXRCO007 Oct 22 '26
It’s the written in C interpreter’s fault
4
u/linuxpuppy Oct 23 '26
What are you talking about? Log4j security is rock solid ;)
19
u/SCUSKU Oct 22 '26
Any dev that says that is an idiot
15
u/Thomasedv Oct 22 '26
I think the bigger point is, this is a memory bug. This is the kind of issue Rust and other memory safe languages can almost entirely avoid. It's the most common flaw in programs, and any language that has those issues is imo fair to criticize given how commonly these issues are found, happen, and long they exist for. Not to mention the most complicated types of bugs to avoid in manually managed systems.
Swapping isn't easy, cheap or even possible but it's pretty clear to me that the future should be built on memory safe languages.
I am a Rust fanatic though, so I am heavily biased.
3
u/TheUruz Oct 22 '26
did Rust hade it? how long ago?
3
u/Suspicious-Click-300 Oct 22 '26
Only languages that are used are bad
3
u/_Sauer_ Oct 22 '26
I've been a Rust dev for a few years now and I know my Rust code can be bad and dangerous; because I'm incompetent.
10
u/pgtaboada Oct 22 '26
That’s not the point. Nobody is claiming other languages are immune to RCE vulnerabilities. The issue is the speed and scale of AI-assisted exploitation—and how cheap it can become. PHP is everywhere, giving attackers an enormous target base.
“Other languages have bugs too” doesn’t address that, and neither does “just keep everything updated.” You can’t assume patching will always outrun exploitation.
6
u/shunyaananda Oct 22 '26
Yeah really there are much better reasons to hate on PHP
8
u/teressapanic Oct 22 '26
Let’s talk about SQL injections
5
u/DerSven Oct 22 '26
Reading this as a Python dev.
2
u/isr0 Oct 22 '26
Actually RCE is my favorite Java feature.
2
u/a_aniq Oct 23 '26
Were those RCEs in the core library though?
2
u/throwaway490215 Oct 23 '26
Rust remote execution bugs get a page about
Meanwhile, PHP devs think their 1 big blob of unsafe C http parsing code is normal and are deflecting about how other systems aren't perfect either.
We have half a dozen safety features that have gone mainstream in the past decade that would have prevented this bug.
Nobody expects perfection, but posting memes like this is enough to show the mindset of the average PHP dev and how far behind they are on technical merit that they do not even realize it.
3
u/Interesting-Yellow-4 Oct 22 '26
I keep my php up to date and have to rewrite everything every so often.
And I ain't quittin
3
u/Fra5er Oct 22 '26
I mean php IS trash though
2
u/aberroco Oct 22 '26
Assembler be like: filthy degenerates, I was born perfect!
2
u/ShvettyBawlz Oct 23 '26
Every single language has vulnerabilities.
2
u/SLOOT_APOCALYPSE Oct 22 '26
I'm glad you listed rust first, that community is b coming and ego echo chamber
2
u/oompaloompa465 Oct 22 '26
feels good to be C# and python dev. Not even a blip on the discussion ...😭
1
u/Professional_Price89 Oct 22 '26
It C problem, nodejs have brotli RCE and also C problem. The gitlab 10.0 RCE today also a C problem.
1
u/[deleted] Oct 22 '26
As someone who works as both JS + PHP dev, I am torn.
1
u/br0ast Oct 22 '26
What emotion am I supposed to be reading from the image? Cheeks?
1
u/packetpirate Oct 22 '26
Me, using plain old HTML, CSS, JavaScript, and Python CGI REST endpoints on my dinky little Apache server on my Raspberry Pi...
😶🌫️
1
u/humanshield85 Oct 22 '26
You know I used php at some point and moved on to other things that seemed better for my task . I never really went back to it on any new project but also when I had to work on projects written in it I didn’t hate it but also didn’t love it.
Seeing this critical issue changes nothing in the way I feel. Shit happens ya know. I just hope they gave the large providers and boaters enough head start to upgrade their systems
What I am mad about is the railway incident, that shit boils by blood. I don’t use railway (nor other services I’m a do it your self and take the blame for everything kinda guy) . But that shit is absurd to let it happen and try to brush it out as so a few api keys got taken oops just rotate them.
1
u/Jbolt3737 Oct 22 '26
I was about to say C has never had such problems but implementations of its standard library functions have in the past caused vulnerabilities (I'm a bit new to C so I guess I should've done that research earlier)
1
u/LutimoDancer3459 Oct 22 '26
Well, php had time to check if thats true for it too. Now its getting fucked because it thought its better than the rest
1
u/sonicpoweryay Oct 22 '26
1
u/gameplayer55055 Oct 22 '26
What about C# - I don't remember any significant cves for it
1
u/lordxray Oct 22 '26
Welcome to the big boys club PHP!
1
u/Danny-9999999 Oct 22 '26
Meanwhile, Python is hiding their pickles.
1
u/Effective-Result6499 Oct 23 '26
Why the fuck is javascript on the other side. It sucks for the same reason: It's too accessible and popular.
1
u/itsallfake01 Oct 23 '26
Remind the Java devs of Log4j
1
u/RewRose Oct 23 '26
Its a matter of rights and responsibilities
You have the right to brag about powering 70% of the internet or whatever
but only if you manage well the responsibility too
1
u/Dave_A480 Oct 23 '26
It's the python guys who should be having that face...
Intentionally and obnoxiously not backward compatible interpreted language that is (a) everywhere, and (b) has versions running unmaintained in production long after end of life because the code they are running isn't compatible with the current version but no one is able to 'just refactor it' like the python devs seem to think we have infinite capacity to do.....
1
u/carrotpilgrim Oct 23 '26
Hello. I like Perl.
1
u/Drycfyvfggcfg Oct 24 '26
Who cares.
1
u/Hacka4771 Oct 24 '26
Node2shell dropped yesterday
1
u/rgeddit_fvker_69 Oct 25 '26
Well none of them had vulnerabilities in the freaking VM and runtime.
1
u/critsalot Oct 22 '26
php has a multi decade history though of it... so you know theres like a blood trail of evidence at this point. it lets developers do things they shouldnt be allowed to do.
1
u/WoodsLovelyDarkNDeep Oct 22 '26 edited Oct 22 '26
Php haters either have never coded with it or have only worked on someone else’s bad code
1
u/Super-Pizza-Dude Oct 22 '26
There are still PHP devs?
1
u/yevelnad Oct 22 '26
rust only got supply chain problems.
-6
u/shrodikan Oct 22 '26
My biggest PHP question is why? Would anyone choose modern PHP for their stack on purpose?