November 21, 2026
A brief Study on PHP2Shell Exploits
A brief Study on PHP2Shell Exploits
By S.M. Mahfuz-ul-Islam
1 min read
Background: PHP2Shell comprised to two major vulnerabilities such as Out-of-memory (OOM) and use after free (UAF) defined by CVE-2026โ109618 and CVE-2026โ109619 respectively. RCE is possible with both weaknesses. Both vulnerabilities involved same fatal-error mechanism which is zend_bailout().
zend_bailout(): is an internal PHP Zend Engine function that abruptly terminates the current PHP execution path and transfers control to an established bailout handler.
If a resource or memory pointer is not properly cleaned up, a stale pointer may cause a Use-After-Free (UAF) vulnerability in a subsequent request. A bailout caused by OOM can contribute to a UAF condition.
Affected PHP versions: Already published by NVD.
Is there any Exploit?
Yes. The Offensive security has already published an exploit on 2026โ10โ22 for pen testers to find this terrible weakness of PHP.
Exploit Details:
The offensive security made a python exploit named 52704.py for linux machine. It is not available in msfconsole.
Pentesters do what?
A Pentesters can run the exploit from /usr/share/exploitdb/exploits/php/remote/52704.py.
Full command line:
python3 exploit.py โ host TARGET โ rce 'id>/var/www/html/proof.txt'
LAB Tested POC:
Mitigation: Already published in NVD