LXer hardens against PHP2Shell
On October 21, the PHP project disclosed two critical vulnerabilities that quickly became known as PHP2Shell. They are serious enough that projects such as SuperTuxKart, along with Wikimedia, DeviantArt and a number of government websites, took systems offline rather than risk being exploited while they patched. LXer runs on PHP, so we want to tell you where we stand, and share what we have learned for anyone else who runs a PHP site. What PHP2Shell isPHP2Shell is the nickname for two flaws in the PHP engine itself, CVE-2026-109618 and CVE-2026-109619. Both are rated critical (CVSS 9.2). In the words of the PHP project's advisory, they "can allow unauthenticated remote code execution": someone with no account and no password can make a web server run code of their choosing.
Because the bugs are in PHP itself, it does not matter how carefully an application is written. Every way of serving PHP is affected: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The PHP project rates mod_php as the highest risk, since a demonstrated exploit fires before any application code runs. Disclosure was planned for October 22 but was moved forward a day after the details leaked. The fix is to update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or to your distribution's patched package. Where LXer standsThis past weekend LXer completed its move to a new server built on Rocky Linux 10.2, with PHP 8.3 running under PHP-FPM and MariaDB 10.11. That server runs PHP 8.3.36, the release that fixes both PHP2Shell vulnerabilities, and we have confirmed that the PHP workers serving the site were restarted after the update was installed. That last check matters more than it might seem, as you will see below.Patching PHP was the urgent part, but it was not the only work. Moving a site that has grown over twenty years onto a modern stack meant going through a lot of old code, and we used the opportunity to harden LXer well beyond this one bug:
None of this makes any site invulnerable, but it shrinks the target considerably. What you can do todayIf you run a website, a blog or an internal tool on PHP, here are the steps that matter, roughly in order.1. Update PHP. Use your distribution's packages wherever you can:
2. Restart PHP. This is the step that is easiest to forget. Updating the package replaces the files on disk, but PHP-FPM workers and Apache with mod_php keep running the old code until they are restarted: sudo systemctl restart php-fpm 3. Check that the new code is really running. Running php -v rpm -qi php-common | grep 'Install Date' systemctl show -p ActiveEnterTimestamp php-fpm sudo dnf needs-restarting -s 4. Remember containers and hand-built PHP. Updating the host does not touch PHP inside a container image. Pull the updated base image and rebuild. If you build PHP from source, upgrade to one of the fixed releases. 5. Leave unsupported PHP behind. PHP 8.1 and older no longer get fixes from the PHP project. Some vendors backport fixes, and the PHP team made minimal patches for 7.4, 8.0 and 8.1 available for this case, but the lasting answer is a supported PHP release. 6. If you truly cannot patch right away, the PHP advisory lists stopgaps that narrow the known attack paths without closing them, among them setting session.upload_progress.enabled = 0 post_max_size 7. Make the next one easier. A few habits pay off every time:
ThanksOur thanks go to the PHP security team and to the distribution maintainers who had patched packages ready on disclosure day. If you notice anything on LXer that looks wrong, please let us know. |
|
This topic does not have any threads posted yet!
You cannot post until you login.
