A guide for businesses
Critical PHP vulnerabilities (php2shell): what to do with an app on an old PHP version
In October 2026 the PHP project released urgent fixes for two critical vulnerabilities, and CERT Polska and the Polish Government Plenipotentiary for Cybersecurity called for immediate updates. Many companies, however, run applications written years ago on a PHP version that no longer receives fixes. For them, updating the server is not enough.
By Michał Drab · · information as of that date
What happened
On 21 October 2026 the PHP team released versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35, which fix two critical vulnerabilities: CVE-2026-109618 and CVE-2026-109619, known as php2shell. Both are rated CVSS 9.2 and can allow remote code execution without logging in. According to the PHP security advisory, every installation serving web requests is at risk, including PHP-FPM, Apache with mod_php and php-cgi.
CERT Polska states that all versions from PHP 5.4 upwards are vulnerable, as is software built on PHP, such as WordPress, Joomla or WooCommerce. CERT-EU noted that the first working proofs of concept are already circulating. On 22 October the Polish Government Plenipotentiary for Cybersecurity recommended that entities of the national cybersecurity system apply the fixes immediately.
Why old applications are worse off
Only supported versions received fixes from the PHP team. PHP 8.1 and older no longer get updates, and according to CERT Polska this includes the commonly used versions 5.6, 7.0, 8.0 and 8.1. For them, fixes may come from Linux distribution or hosting providers. The PHP team also published minimal patches for versions 7.4, 8.0 and 8.1, but only for those who build PHP themselves.
That is a patch for one specific flaw, not a return to support. Future bugs in old versions will not be fixed. Even PHP 8.2, which did receive the fix, reaches end of support on 31 December 2026.
The most common reason a company stays on an old version is simple: the application does not work on newer PHP. The code uses removed functions or libraries that are no longer maintained, or nobody knows what will break after the change.
What to do right away
- Find out which PHP version each of your applications runs on: internal system, online store, WordPress site, customer portal. The hosting panel or the server administrator usually shows it.
- If the version is supported, update PHP to the fixed release or check whether your hosting or distribution provider has done so. Appliances and applications shipped as ready-made images (e.g. Docker) are updated by their vendor.
- If the version is older, ask your hosting or distribution provider whether they have shipped a fix for it.
- Before making changes, back up the files and the database and check that the backup can be restored.
- If the application cannot be secured quickly, restrict access to it from the internet, e.g. through a VPN or a list of allowed IP addresses.
Until the update, CERT Polska and the Government Plenipotentiary recommend setting in php.ini:
memory_limitset to-1if the server resources allow it, otherwise 128M or more,post_max_size: 8M or less,max_input_vars: 1000 or less,session.upload_progress.enabled: Off.
These settings only make an attack harder; they do not remove the flaw. They can also block larger file uploads, so check that the application still works after the change. Only updating PHP fully protects you.
If you see signs of a break-in in Poland, report it to CERT Polska at incydent.cert.pl.
Why an application does not move to newer PHP on its own
Every major PHP version removes or changes some functions. For example, PHP 7.0 removed the old mysql_* database functions, and PHP 8.0 removed each() and create_function(), among others. There are more changes, described in the migration guides in the PHP documentation.
On top of that come old versions of libraries and frameworks that do not run on newer PHP, and missing tests that would show what stopped working. That is why moving to a supported version usually means work in the code, not changing one server setting.
Updating the code or rewriting the application
Often it is enough to update the code to a supported PHP version while keeping the existing logic: replace removed functions and outdated libraries, then check the whole application in a test environment. This keeps the rules and exceptions the company has built up over the years.
A rewrite makes sense when the code is so tied to an old version or an unmaintained framework that an update would mean changing most files, or when the application needs rebuilding for other reasons anyway. Even then, it can be rewritten module by module rather than all at once.
Rewrite your system from scratch or modernize it? How to decide
Security along the way
Since the code is being changed anyway, it is worth removing the weak points typical of older PHP applications:
- database queries built by concatenating strings instead of parameterized queries,
- user passwords stored in a weak form instead of using password_hash(),
- forms without protection against forged requests (CSRF) and output displayed without protection against script injection (XSS),
- database passwords and external service keys stored in the code,
- libraries copied by hand instead of managed and updated with Composer.
A useful reference is OWASP ASVS, a standard describing security requirements for web applications. When updating and rewriting applications from older PHP, I follow current security recommendations, and every change is checked in a test environment first.
How to plan it
- An inventory of PHP applications and their versions.
- A code review: what blocks the move to a supported version and where the security weak points are.
- A test environment with the new PHP version and a copy of the data.
- First stage: the application runs on a supported PHP version. When work is done in stages, it usually takes 4–8 weeks.
- Next stages: security fixes and further development, without stopping the company’s daily work.
Questions about PHP vulnerabilities and old applications
Is my application vulnerable?
If it runs on PHP and serves traffic from the internet, probably yes, unless PHP has already been updated to a fixed release or your provider has shipped a fix. Check the PHP version in the hosting panel or with your administrator.
I have PHP 7.4 on my hosting. What now?
The PHP team no longer releases updates for this version. Ask your hosting provider whether they have applied a fix, use the recommended settings in the meantime and plan moving the application to a supported version.
Is changing the php.ini settings enough?
No. The settings recommended by CERT Polska make an attack harder but do not rule it out. Only updating PHP fully protects you.
Does the whole application have to be rewritten?
Not always. Often it is enough to update the code to a supported PHP version. A rewrite makes sense when an update would mean changing most of the code, and even then it can be done in stages.
What should I prepare for a conversation?
The PHP version and hosting details, access to the code and server if available, and a list of the key functions that must keep working without interruption.