Cyber:Assist.Zone / Knowledge
Blog & knowledge base
Practical guidance for threat intelligence and evidence investigation.
PHP2Shell: The Challenge of Securing 15-Year-Old PHP Applications
Cyber:Assist.Zone Team October 22, 2026
I recently received a security alert from News & Reports about PHP2Shell (CVE-2026-109618 and CVE-2026-109619), affecting several legacy PHP applications I support.
Some were originally developed for PHP 5 and have been running for more than 15 years. They still do their job, but updating them is not easy. PHP 8 has removed many functions used by the old code.
Here is the flow:
1. Took the applications offline.
First priority was to stop potential exploitation while assessing the risk.
sudo systemctl stop apache2
2. Added HTTP Basic Authentication.
Some applications still needed to be accessible, so I added HTTP Basic Authentication at the Apache level to restrict access. This was a temporary measure, not a fix for the vulnerability.
sudo vim /etc/apache2/sites-available/...
sudo vim /etc/apache2/conf-available/security.conf
sudo htpasswd -c -B /etc/apache2/auth/.htpasswd user
sudo apache2ctl configtest
sudo systemctl start apache2
3. Updated the legacy PHP 5 code.
Used AI to help migrate the old code to PHP 8.x. This saved time, especially when replacing deprecated functions and old database calls.
I manually reviewed the changes and tested the main application functions. AI was helpful, but not something I would trust blindly with production code.
4. Waited for security patches.
Monitored Ubuntu security updates. After a few hours, the updated packages became available.
sudo apt update
sudo apt upgrade
5. Fixed compatibility issues.
Updating PHP packages was straightforward. Getting the applications to run properly was harder.
Had to fix database connections, PHP extensions, removed functions and several runtime errors.
6. Verified the fix using a PoC.
Ran a proof-of-concept test against the patched environment to confirm the vulnerabilities could no longer be exploited.
Also checked application functionality and Apache/PHP error logs.
7. Restored access.
Once the security checks and functional tests passed, restored normal access to the applications.
Outcome
The applications were updated, the security fixes were verified, and the services were back online.
The biggest challenge wasn't PHP2Shell itself. It was getting 15-year-old software to work with a modern PHP version without breaking existing functionality.
AI helped speed up the code migration, but manual review and testing were still essential.
A good reminder that maintaining legacy software takes much more than running apt upgrade.