You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

Almost done. Check your inbox and press the button in our email to confirm. Close

We could not check that you are a person. Please try again. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

Previous episode PHP file uploads: how one strange form trips PHP before a website even starts

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. 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.

    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. 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.

    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. 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.

    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. 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.

    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. 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.

    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. 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.

    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.

  7. Go further

    Two names worth knowing.

    Two names worth knowing.

Next episode The PHP bug that leaked before its fix: how php2shell attacks began on day one

Share this comic

More comics