Amazon identifies Oct 17 PHP2Shell exploitation prior to public disclosure
Posted by cubefox 8 hours ago
Comments
Comment by andyvanosdale 4 hours ago
Essentially, the PHP team is deflecting and abdicating their responsibilities in all this mess they created. "Chainguard broke embargo", "support us with money", "we are just volunteers", "we had knowledge years ago but no POC because we wanted to ship features and not security fixes". All just deflections.
This fiasco shows me that I would never use PHP for any project I'm part of. The PHP team royally messed up, and they are deflecting the blame left, right, up, and down.
Comment by JaggedJax 3 hours ago
Yes, we live in a new world now and need to handle disclosures differently by learning from this experience. The first major RCE disclosure that came with 3rd party leaks of this era was bound to cause these issues no matter who it affected. Let's hope the next one is better.
The major mistake I see in this incident on the disclosure side that kicked this all off was Calif posting their video early because they took vibe coders on X at their word. Maybe the early notice by PHP of an upcoming release was a mistake in hindsight given how people reacted.
[] Is this standard in the security researcher world? Let's beat embargo by a few hours and cause extra panic by putting more people at risk?
Comment by andyvanosdale 2 hours ago
Nothing is standard in the security researcher world. I have no interest in PHP nor Chainguard, but I have a greater interest. PHP folks can deflect the blame to Chainguard, but really, it's the PHP team who mishandled this from years ago. There were likely other disclosures or discoveries of this, if Amazon were starting to see this probed on October 17. Heck, OpenAI found this at nearly the same time as the original POC disclosure.
Comment by JaggedJax 2 hours ago
Maybe we are arguing that they should have release early because of the possibility of it being exploited, but I do believe PHP (and others who backed it up) when they said they reviewed the exploits flying around on Twitter and verified those would not be able to successfully perform this exploit.
And again, Amazon is not saying they saw this being probed on Oct 17th. They are saying that today, in hindsight, they see this in logs from the 17th (unknown if it would have been successful either). If Amazon clarifies that they saw this in the wild at the time, then I agree with you. They just didn't say that.
Comment by dlor 1 hour ago
I'd rather we all collectively spend this time talking about how we go fix all the rest of the vulnerabilities we (and everyone else) are finding as quickly as possible and get the patches and mitigations deployed to everyone that needs them as quickly as possible over the coming months.
(I'm the guy that decided to release these early)
Comment by wat10000 2 hours ago
If it is, then you just want to get it out as fast as possible.
The PHP team thought they were in the first case and acted accordingly. Turns out they were in the second case. But I see no indication they could or should have known that. They made the right decision with the info they had.
Comment by gilrain 4 hours ago
Comment by EGreg 3 hours ago
We use it ourselves in our deployments, and yesterday I released it free under MIT license, for anyone who is unwilling or unable to patch their PHP (which is probably millions of servers right now):
Comment by andyvanosdale 3 hours ago
If a system is accessible by someone else, it is inherently insecure and needs to be hardened.
Comment by e28eta 2 hours ago
And in a case like this, with so many exploitable PHP boxes out there for attackers to choose from instead, certainly buys you some additional protection.
I wouldn’t choose to roll my own on the day I needed it though.
Comment by EGreg 3 hours ago
Relying on this patch, you're only protected against these specific CVes, but in general a proxy can protect you from more. It's strictly additive security, right?
And if you can't or won't patch your PHP, this is strictly better than getting pwned and having your PHP-FPM execute arbitrary commands. That's as bad as it gets, and you better hope that Linux user permissions can constrain it, but your apps are basically gone. PHP-FPM even allows PHP to overwrite .php files, meaning next time they are hit, it's completely arbitrary code that persists.
As a side note: https://qbixserver.com is a project I started several months ago, that is a pure PHP server without needing nginx, and it forks after loading your classes, instead of preforking like php-fpm. It's not vulnerable to php2shell, and it is able to rewrite php code on the fly when it loads it, to make it more safe. It does things like disallowing your php scripts to write to .php files, and it makes require($filename) check that $filename actually ends in .php ... a lot of stuff like that.
The security added by this proxy is strictly additive, it can't make things worse. This proxy can be run by a Linux user with no permissions at all, so it just transforms input. Can it have a sleeper code that transforms input in a way that causes your PHP to do something even worse? Well, this is why you should point Claude at the repo and ask it if it has any backdoors. It's completely open source and GitHub actions has been used to build the binary. So I guess if you don't trust GitHub, you can also compile it yourself, but then you're trusting GCC. (Ken Thompson has an interesting talk on Trusting Trust of compilers, from 30 years ago.) But at this point we're way past what people usually are concerned about.
Comment by zdragnar 2 hours ago
No, the proxy itself may have memory vulnerabilities that could give attackers remote code execution capabilities.
Comment by EGreg 2 hours ago
Comment by hemlock4593 2 hours ago
Except if this code contains bugs that lead to another RCE.
> Well, this is why you should point Claude at the repo and ask it if it has any backdoors.
When do people understand that LLMs are no oracles. Just because some LLMs tell you the code is safe or has no backdoor doesn't mean it is true.
Comment by 8note 2 hours ago
if it tells me there is a backdoor, and shows me how its used, i can be pretty sure that there is one though.
if claude cant find the backdoor, chances are that claude cant find a backdoor. its still not an oracle, but that is still useful feedback for updating priors
Comment by EGreg 2 hours ago
1) The proxy is open source and much simpler than PHP runtime or a web application. Its code only takes input and generates output. It is basically a pipe. It has no other capabilities to exploit.
2) The operating system, such as BSD or Linux, supports running processes under a user and enforces limits on that user. So you just jail this proxy — since it has one purpose. Unlike your application, which may do many things and you can’t restrict it, it may become a confused deputy
What this has taught me is that we should decouple as much as possible into microservices, so that we can properly sandbox each service, and that way we have chokepoints.
Comment by petcat 3 hours ago
Comment by EGreg 2 hours ago
It’s very simple to check it though. And to sandbox it to have zero read and write permissions to any files. About all it can do in a malicious direction is drop requests or deliver malformed requests, and it is straightforward to see there is no way the code will allow that.
Comment by fn-mote 1 hour ago
Comment by mirashii 1 hour ago
Additionally, the author isn't engaging on this site in good faith. See this thread https://news.ycombinator.com/item?id=50181138 from yesterday, where egregious vulnerabilities in this project were pointed out, at which point the author force pushed to hide the history, failed to fix the vulnerabilities pointed out (e.g. https://github.com/Qbix/proxy/blob/5a9f8a96f4bdaaaa5444b6986... still doesn't match the PHP multipart parser, so the whole defense can be mooted by switching to a space as the delimiter). This is an exemplar of slop.
Comment by bigwheels 2 hours ago
Comment by EGreg 2 hours ago
Either way, memory leaks here aren’t too relevant.
I just posted about it here a half hour ago: https://news.ycombinator.com/item?id=50197861
Comment by dabinat 1 hour ago
Why would memory leaks in a long-running service not be relevant?
Comment by redox99 2 hours ago
Comment by cute_boi 4 hours ago
No serious project should use PHP.
Comment by tredre3 2 hours ago
This could not be further from the truth. Backwards compatibility is a big reason why PHP doesn't have <your favorite missing feature that is totally a dealbreaker and PHP is thus unusable>. Odds are if you look at their RFCs and internals mailing list you'll likely find proposals and even implementations for any BC-causing feature you can think of.
Comment by jasonlotito 1 hour ago
> I would never use PHP
That you would trust liars and people who are anti-security is telling.
Comment by DonHopkins 4 hours ago
>5.3.7 upgrade warning: [22-Aug-2011] Due to unfortunate issues with 5.3.7 (see bug#55439) users should postpone upgrading until 5.3.8 is released (expected in a few days).
No seriously, he's literally as careless as he claims to be (when he says that repeatedly, you should believe him!), and his lack of giving a shit about things like tests and encryption and security that are extremely important has caused actual serious security problems, like breaking crypt() by checking in sloppy buggy code that would have caused a unit test to fail, but without bothering to run the unit tests (because so many of them failed anyway, so who cares??), and then MAKING A RELEASE of PHP 5.3.7 with, OF ALL THINGS, a broken untested crypt()!
Does anyone think that's just his sense of humor, a self deprecating joke, breaking then releasing crypt() without testing, that's funny in some context? What context would that be? Do they just laugh and shrug it off with "lol let Rasmus be Rasmus! ¯\_(ツ)_/¯ "?
https://www.reddit.com/r/programming/comments/jsudd/you_see_...
>r314434 (rasmus): Make static analyzers happy
>r315218 (stas): Unbreak crypt() (fix bug #55439) # If you want to remove static analyser messages, be my guest, but please run unit tests after
https://web.archive.org/web/20140818115440/http://svn.php.ne...
https://web.archive.org/web/20111014213651/https://plus.goog...
>Rasmus Lerdorf
>+Lorenz H.-S. We do. See http://gcov.php.net
>You can see the code coverage, test case failures, Valgrind reports and more for each branch.
>The crypt change did trigger a test to fail, we just went a bit too fast with the release and didn't notice the failure. This is mostly because we have too many test failures which is primarily caused by us adding tests for bug reports before actually fixing the bug. I still like the practice of adding test cases for bugs and then working towards making the tests pass, however for some of these non-critical bugs that are taking a while to change we should probably switch them to XFAIL (expected fail) so they don't clutter up the test failure output and thus making it harder to spot new failures like this crypt one.
Comment by hyperpape 7 hours ago
Unfortunately, if you read the announcement as referring to 14:00 UTC, that's several hours after Chainguard published their images. I don't know if it's plausible that people saw the Chainguard builds, understood the issue from those and built exploits, but a precise timeline would help understand better.
Comment by sullivanmatt 6 hours ago
Comment by 00deadbeef 7 hours ago
Comment by cubefox 7 hours ago
Comment by post-it 6 hours ago
Comment by cubefox 5 hours ago
Comment by stickfigure 5 hours ago
It could also just have been a run-of-the-mill exploit in WordPress.
Comment by cubefox 4 hours ago
Comment by wahern 5 hours ago
Comment by qingcharles 2 hours ago
Comment by fn-mote 5 hours ago
Sure about that?
Not my understanding of how the LLMs currently work. There’s a cutoff date and no new info after that date is included in training.
Info to the contrary welcome.
Comment by jonhohle 4 hours ago
However, I’ve done some original research regarding an area that the internet has wrong and that doesn’t seem to have back propagated yet.
Comment by wat10000 1 hour ago
But if something hasn't been posted online publicly, they won't know about it.
Comment by disgruntledphd2 5 hours ago
You are almost certainly correct in terms of how the public models work. I guess it's possible that the labs have some tools connected for more recent stuff like this, but it seems unlikely.
Comment by dofm 4 hours ago
And an odd little cluster of potential attempts it caught just after 9am GMT. Again I can't see any reason why I would be getting multipart form posts to those URLs, it's definitely an exploit, but it's possible there's another older exploit with that pattern. They aren't WP-type URLs though.
Comment by DavCreator 2 hours ago
Comment by VladVladikoff 7 hours ago
Also this post from Amazon is embarrassing. They knew about it from the 17th yet failed to meet the embargo timeline and patch Amazon Linux (their patch is due to be released today the 22nd of Oct).
Comment by athrowaway3z 30 minutes ago
Comment by onionisafruit 6 hours ago
Comment by boplicity 6 hours ago
Comment by menomatter 6 hours ago
Comment by tylergetsay 5 hours ago
Comment by artnap 3 hours ago
Comment by decidu0us9034 2 hours ago
Comment by kyledrake 1 hour ago
Curiously, all of the requests were coming from Cloudflare-controlled IP addresses (Workers? VPN? Internal server?). This of course means that these attempts would succeed for anyone that was whitelisting Cloudflare IPs but blocking others.
I tried to get this information over to them, but their abuse contact form does not allow you to submit unless you have a non-IP domain URL as evidence, which I didn't have because it's just source IPs. Suffice to say if you are behind Cloudflare and think whitelisting only their IPs is protecting you, think again.
Comment by ferngodfather 1 hour ago
No, the ranges Cloudflare tells you to whitelist are only their proxy ranges. Workers and all the other junk comes from other ranges that won't be whitelisted.
Of course it's a different matter if you're just whitelisting their AS.
Comment by hannob 3 hours ago
Something that would lead to an uncontrolled memory corruption, potentially leading to a crash, or something that indicates a real, code-executing exploit? Those two kinds events are of very different significance. I can't read from Amazon's announcement which one they think they saw.
Comment by Tomdarkness 6 hours ago
https://github.com/amazonlinux/amazon-linux-2023/issues/1148
I don't think this blog post is sending the message AWS intended...
Comment by boplicity 6 hours ago
Comment by Tomdarkness 6 hours ago
"Subsequently, from 2026-10-21 0200 UTC to 2026-10-21 0800 UTC, Amazon Threat Intelligence identified additional exploitation attempts of PHP2Shell targeting MadPot from additional anonymized infrastructure." (i.e almost 12 hours before the release of the patch)
"Invest in detections that don’t rely on a signature for a specific CVE. The first exploitation will often come before those signatures exist."
"We analyze over 200 billion events per minute and integrate threat intelligence from our MadPot honeypot network to identify and block known exploitation attempts in real time. Our honeypot system provides us with early detection of exploitation attempts, enabling rapid response and threat analysis."
Comment by OtherShrezzing 5 hours ago
Comment by paxy 4 hours ago
The PHP foundation needs to give a better answer for why they were asleep at the wheel for 2+ months while insiders were sharing/selling the info.
Comment by nicce 3 hours ago
Comment by athrowaway3z 26 minutes ago
Comment by makmanalp 6 hours ago
Comment by system2 2 hours ago
Comment by bzmrgonz 6 hours ago
Comment by mazzma 5 hours ago
Comment by bcvvvy 7 hours ago
Same as none of their AMIs for bottlerocket have emSign revocations.
Absolutely shit company who puts their customers at risk.
Comment by monksy 2 hours ago
Comment by bcvvvy 1 hour ago
Comment by chimeracoder 4 hours ago
Last I checked, Amazon has also not patched their Lightsail blueprints for WordPress, or even communicated about the vulnerability with those customers at all, which is arguably way worse, because
(a) by design, all-in-one blueprints aren't really intended to use system PHP or have system PHP updated in a meaningful way; and
(b) hosting static sites such as WordPress is 90% of the selling point of Lightsail as a product
Comment by asah 6 hours ago
Comment by Tomdarkness 6 hours ago
Comment by otterley 5 hours ago
Comment by AnthonyMouse 4 hours ago
Comment by otterley 4 hours ago
Meanwhile, WAFs are being continuously updated with detection signatures.
Comment by AnthonyMouse 4 hours ago
Comment by otterley 4 hours ago
As for WAF rules, those can usually be flipped on and off with a single switch.
Comment by AnthonyMouse 4 hours ago
The trouble is if the WAF change e.g. messes up a redirect or turns a success response into an error response or vice versa, which confuses some other system into giving multiple users the same session cookie and gives them access to one another's accounts or writes corrupt entries to the database or whatever it is. You can revert the rule but that doesn't revert the state changes that have already happened.
There is inherently a trade off between keeping the system online, keeping the system patched and testing the patch before applying it.
Comment by otterley 4 hours ago
Sometimes. In a world in which customers are increasingly adopting immutable infrastructure patterns and (contrary to best practice) using Launch Templates with symbolic references to `latest` versions of AMIs, this isn't always easy.
> There is inherently a trade off between keeping the system online, keeping the system patched and testing the patch before applying it.
On this we agree 100%.
Comment by bcvvvy 6 hours ago
Comment by otterley 5 hours ago
Any vendor that delivers updated packages without thorough regression testing that ends up causing an incident for their customers as a result will get a thrashing from the community. Remember the CrowdStrike BSOD incident in 2024?
Maybe Ubuntu and others are cutting corners to deliver more quickly. It's their risk to take, but it's still a risk.
Comment by bcvvvy 5 hours ago
If you need to test it you should pin packages.
Comment by otterley 4 hours ago
Unfortunately people rarely follow best practices.
Customers frequently do risky things like using launch templates that refer to the latest AMI. AMI changes, Auto Scaling launches a new/replacement instance in the fleet without adequate testing, *boom*.
Comment by cookiengineer 3 hours ago
Comment by otterley 5 hours ago
Comment by ActionHank 6 hours ago
To the person at amazon that thought this was a good press release to put out, I know this is what you were hoping for, so here it is, "wow, so cool". Not sure why, but AI really has everyone running around with desperate loser aura.
Maybe next time, do better, actually patch some things so your customers are covered?
Comment by ActionHank 6 hours ago