php2shell: the PHP vulnerability that shook the web in 2026
Remote code execution: how a crash in PHP gave strangers a shell on the server
A crash is the most boring thing a program can do. With php2shell, a crash in PHP was only the first step. The next one gave a stranger a way to type commands on servers he had never seen.
-
1
PHP does not start fresh for each visitor. One running copy of it, called a worker, handles a request, then the next one, then the next.
-
2
That is where another bug hides. A note from Rono's last request survives into the next one. It still points at a spot in memory. PHP thinks that spot is free and gives it to the next request.
-
3
Rono's next request lands right in that spot. PHP sends back a cookie, a small piece of text for the browser. Rono makes it very long, so it carries pieces of PHP's memory too. From those pieces, he learns where things sit in memory.
-
4
With that map, Rono writes his note right where PHP keeps its next order. And PHP follows it: it runs Rono's command, on your server.
-
5
A window where you type commands to a computer is called a shell. A stranger who makes your server run his commands from far away has remote code execution. From PHP to a shell: php2shell.
-
6
The page Rono gets back looks normal. This time, nothing crashes, and no error goes into the logs, the server's diary. Your blog looks fine, and your server now takes orders from Rono.
-
Go further
Two names worth knowing.