Establish a repeatable PHP patch process with pinned container images, vulnerability scanning, runtime inventories, and an incident runbook.
Emergency patching works once, under pressure, when the whole team drops everything. That is how Brightline Logistics survived the October 2026 PHP2Shell release, but a second critical Common Vulnerabilities and Exposures (CVE) notice next quarter should not require the same scramble. Turning what you did across the last seven lessons into a calm, repeatable patch management process means the next PHP advisory takes an hour instead of a weekend.
Previous lesson: Harden PHP and PHP-FPM Configuration
You cannot patch what you do not hear about on time. During PHP2Shell, the CVE identifiers leaked on 20 October 2026 and the PHP team released patches on 21 October at 14:00 UTC. Teams that only read weekly newsletters found out days after exploitation had already started.
Set up direct signals from the places that actually publish fixes:
php-announce mailing list, which announce every new release and security fix directly.php repository on Docker Hub, so you know when php:8.3-fpm or php:8.4-fpm has been rebuilt.Pro Tip: Route the php-announce list and your Linux vendor advisories into a dedicated channel in your team chat or ticketing tool so one person being on vacation never delays a patch.
Many PHP teams run composer audit in their Continuous Integration (CI) pipeline and assume their PHP stack is covered. Here is the catch: composer audit checks your application's third-party libraries in composer.json against known security advisories. It does not check the PHP runtime binary, the web Server Application Programming Interface (SAPI), or system libraries.
Think of it like checking every tire on a car but never looking at the engine. Both matter, and neither replaces the other.
For brightline-portal, a clean composer audit run on 21 October 2026 would have reported zero vulnerabilities while the container was still running an unpatched PHP 8.3 FastCGI Process Manager (PHP-FPM) binary vulnerable to CVE-2026-109618 and CVE-2026-109619.
| Check Type | Tool Examples | What It Catches | Catches PHP2Shell? |
|---|---|---|---|
| Dependency audit | composer audit | Vulnerable Composer packages in vendor/ | No |
| Host package check | apt, dnf, OS vulnerability scanners | Outdated PHP, Apache, nginx and C libraries on servers | Yes |
| Container image scan | Trivy, Grype | Vulnerable OS packages inside Docker images, and the PHP runtime when the scanner can identify it | Not always, so add a version check |
Common Mistake: Treating a green composer audit job in CI as proof that your PHP servers are patched. You need both a dependency check and a runtime check in your pipeline.
When you build a container from a moving tag like php:8.3-fpm, two builds run a month apart can produce different PHP patch levels, or worse, a cached layer on your build runner can keep serving an old, vulnerable image for months.
Pin the exact patch version in your Dockerfile so every engineer and every scanner can see the exact PHP version in git. Alongside pinning, schedule a weekly CI job that updates that tag or rebuilds with --pull so operating system library fixes inside the base image arrive without waiting for a code change.
Here is how Brightline updates the Dockerfile for brightline-portal:
Before:
dockerfileCopy
After:
dockerfileCopy
In your CI build step, always pass --pull and scan the built image before pushing it to your registry:
bashCopy
The official php images compile PHP from source instead of installing it as an operating system package, so an image scanner may not recognize the PHP version at all. The one-line version_compare check is what guarantees the build fails on an unpatched PHP. Update the version number in it whenever you move to a new PHP release.
Generating a Software Bill of Materials (SBOM), which is a machine-readable list of every package inside an image or server, lets you search all your deployed artifacts in minutes the next time a critical CVE drops.
In Lesson 2, you built an inventory of every PHP binary, web SAPI, and host across Brightline Logistics. If that list sits in a forgotten spreadsheet, it will be wrong within three months.
Keep the inventory in your repository or configuration database as a living table with five required columns: application name, team owner, PHP version, web SAPI, and where it runs.
| Application | Owner | PHP Version | Web SAPI | Host or Base Image |
|---|---|---|---|---|
brightline-www | Marketing Web | 8.1 (Ubuntu backport) | Apache mod_php (migrating to FPM) | Ubuntu 22.04 VM |
brightline-portal | Customer Platform | 8.3.37 | PHP-FPM behind nginx | Docker php:8.3.37-fpm |
brightline-invoicing | Finance Systems | 7.4 (isolated, upgrading to 8.4) | PHP-FPM | RHEL 8 internal VM |
Review this table once a month and require every new service or decommissioned server to update it as part of the deployment checklist.
When a CVSS 9.2 vulnerability is announced, nobody wants to read a forty-page policy document. Write a one-page runbook stored in version control that tells the on-call engineer the exact order of operations:
mod_php servers first, then internet-facing PHP-FPM apps, then internal systems, and finally CLI-only workers.php.ini or the FPM pool using php_admin_value and php_admin_flag, tighten request size limits at the proxy or Web Application Firewall (WAF), or isolate the host from the public internet.apt or dnf), rebuild container images from pinned patched tags with --pull, and confirm managed hosting status.php -v and the web SAPI version, and grep the distribution package changelog for the CVE numbers (CVE-2026-109618 and CVE-2026-109619).Quick Challenge: Look at your own team's documentation right now. Could an engineer who joined last week find the list of every PHP server and the exact restart commands in under five minutes?
Pro Tip: Artificial intelligence (AI) tools such as Workik can speed up drafting your runbook, reviewing php.ini files, or planning an upgrade from PHP 7.4 to 8.4, as long as an engineer reviews and tests every change before it reaches production.
Create a starter runbook and verification script for your own environment in a safe local directory:
bashCopy
Next, add a three-row inventory table in a PHP-INVENTORY.md file for the applications you maintain, filling in the owner, current PHP version, web SAPI, and how each one gets patched.
You have now worked through the complete PHP2Shell response: understanding CVE-2026-109618 and CVE-2026-109619, finding every PHP runtime and SAPI, applying patches and temporary mitigations, hunting for exploitation in your logs, retiring end-of-life PHP, hardening PHP-FPM, and putting a repeatable patch process in place for whatever comes next.
Was this lesson helpful?