Memory corruption (use-after-free)
Japanese 解放後使用(Use-After-Free)
A flaw where a program keeps using memory it has already freed. PHP2Shell exploits the state left behind after an out-of-memory error.
While a program runs, it borrows bits of the computer's memory and hands them back when it is done. Handing memory back is called freeing it. A use-after-free is a flaw where the program mistakenly uses memory it has already handed back. It is like a hotel guest's key still opening the room after checkout, so they can touch the belongings of the next guest. Attackers use that gap to slip their own content into the memory and get the program to follow it.
For example PHP2Shell targets the state left behind, not properly cleaned up, after an error caused by running out of memory. So if your server records (the logs) show an out-of-memory error or a '500' error right after a suspicious request, it may be a trace of an attack attempt. A site owner cannot block this kind of flaw with a setting, so the real fix is to upgrade to a patched PHP version. If you see errors like these, save that part of the logs separately.
Source: PHP Group, “Security advisory: Critical remote code execution vulnerabilities, update now” · Wiz Research, “PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet” (checked 2026-10-26)