Outdated PHP
A web server runs a PHP release that is missing security fixes or belongs to a branch that no longer receives them.
| Severity | High |
| CVSS 3.1 | 8.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H Open in the calculator |
| CVSS 4.0 | 9.2 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-1395: Dependency on Vulnerable Third-Party Component |
| OWASP Top 10 | A03:2025 Software Supply Chain Failures |
| MITRE ATT&CK | T1190 Exploit Public-Facing Application |
| Category | Outdated Components |
Description
A web server runs a release of PHP that predates fixes for one or more published vulnerabilities, or a release branch that has reached end of life. The PHP project supports each release branch with bug and security fixes for two years, then with fixes for critical security issues only for a further two years, after which the branch receives no fixes at all and newly found flaws remain unfixed.
Depending on the vulnerabilities present and how the application uses PHP, an attacker may be able to run code on the web server, read files or memory, or cause denial of service. Past PHP vulnerabilities include memory corruption in built-in functions and extensions, a flaw in the FastCGI Process Manager (PHP-FPM) that allowed remote code execution in some configurations (CVE-2019-11043), and argument injection in PHP-CGI on Windows (CVE-2024-4577). Many PHP flaws are reachable only when the application passes attacker-controlled data to the affected function, while others, such as those in PHP-FPM and PHP-CGI, depend on how PHP is connected to the web server and can be exploited directly over HTTP without any weakness in the application: both CVE-2019-11043 and CVE-2024-4577 were widely exploited and are listed in CISA's Known Exploited Vulnerabilities (KEV) catalogue. Code execution runs with the privileges of the PHP or web server account and typically exposes the application's source code, configuration secrets such as database credentials, and the data it handles.
The finding is usually raised from the X-Powered-By header, error pages or exposed phpinfo() output, or from installed packages in an authenticated scan, and scanners report one result per advisory affecting that version. Linux distributions backport fixes into the PHP version they ship without changing its version number, and some keep branches that the PHP project has retired supported for the life of their own release, so results should be confirmed against the distribution's advisories.
Remediation
Move to a supported, current PHP release:
- Upgrade to the latest release of a PHP branch that is still supported, as listed by the PHP project, or install the distribution's latest PHP packages where PHP comes from the operating system. Test the application first, as moving between branches can remove deprecated functions.
- Where the application cannot yet run on a supported branch, use a distribution or vendor that still provides security fixes for the branch in use, and plan the code changes needed to upgrade.
- Run PHP through PHP-FPM or the web server's PHP module rather than as a CGI binary, and keep the web server's PHP handler configuration in line with the PHP and web server documentation.
- Set
expose_php = Offinphp.inito remove theX-Powered-Byheader, and remove anyphpinfo()pages; this hides the version but does not fix anything.
Confirm the fix by checking the version with php -v and the version the web server actually uses, which can differ where several PHP versions are installed, then repeat the scan.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.