r/openziti • u/AccordionGuy • 25d ago
Notes and article on PHP2Shell
[ Still on vacation for another couple of days, but this was too big to ignore. ]
On the very off chance that you missed it: PHP2Shell is CVE-2026-109618 and CVE-2026-109619 (CVSS 9.2, unauthenticated RCE in the PHP engine). Details leaked on October 20, a day before planned disclosure, and it was being exploited before patches were out.
The bug is in PHP's HTTP request parsing, which happens before any application code runs. Login checks, framework middleware, and access rules haven't executed yet when the payload lands. The only precondition is that the attacker can reach your listening port.
That's exactly the problem dark services are designed to solve. If the PHP app sits behind OpenZiti, the setup looks roughly like this:
Run
ziti-edge-tunnelon the PHP host (or a box that can reach it) with a hosting identityCreate a service with a
host.v1config that forwards to the web server on127.0.0.1, and anintercept.v1config for an address likeintranet.zitiAdd a Bind policy for the hosting identity and a Dial policy for the people or workloads that should reach it
Bind the web server to localhost and close the inbound port
The tunneler only makes outbound connections to your edge routers. A scanner sweeping for PHP servers finds nothing listening, and an unenrolled client can't even open a connection, so the malicious request never reaches the parser.
Things to note:
This doesn't fix the bug. An authorized identity could still send the payload, so patch anyway: 8.5.12, 8.4.27, 8.3.36, or 8.2.35. Then restart PHP-FPM / Apache so the old code leaves memory, and check your logs.
A public site that has to serve anonymous visitors still needs a listening port. The best candidates for going dark are the things that never should've been public: wp-admin, cPanel, phpMyAdmin, internal tools, CRMs, staging servers.
Instead of "anyone on the internet" being able to reach the parser, only "identities you enrolled and authorized" can. Since each identity reaches only the services it's authorized for, a compromised one can't wander the network.
Article: https://netfoundry.io/breach/php2shell-your-login-never-gets-a-vote/
Docs, if you want to try it: https://openziti.io/docs
Question for the folks here: Anyone already running PHP apps as dark services? I'd love to hear what you put behind Ziti first, and what tripped you up.