Two critical PHP vulnerabilities and 40 minutes – how an AI agent patched my servers
PHP's security team warned of two critical vulnerabilities that let an attacker run code on a server without credentials. The fix shipped the next day, and 40 minutes later every server running my PHP sites was patched.
Markus Haataja
24. October 2026
On Tuesday evening, 20 October, at 22:33, PHP's security team sent out an advance notice: the next day they would release a fix for two critical vulnerabilities. Both score 9.2 out of 10 on CVSS, and at worst both let an attacker run their own code on the server – without credentials, and before the site's own code has even started.
I run client sites and my own on fifteen servers across three cloud providers: Hetzner, UpCloud and DigitalOcean. Some run Ubuntu, some Debian; some were set up by hand years ago, others through a control panel. That kind of variety is normal for a small operator, and it's exactly why an urgent update usually eats a whole evening.
This time the last server was patched 40 minutes after the fix was released.
What the vulnerabilities do
CVE-2026-109618 and CVE-2026-109619 are memory-handling bugs in PHP.
- CVE-2026-109618: When PHP runs out of memory in the middle of a request, some of the request's internal data is left half-initialised. Cleanup still treats it as valid, and that can be turned into code execution.
- CVE-2026-109619: A request's internal state can outlive the memory behind it. A later request handled by the same worker can use that stale state.
Every PHP installation that serves web requests is affected: PHP-FPM, Apache's mod_php, php-cgi, FrankenPHP and LiteSpeed. The risk is highest for mod_php, where a working attack has already been demonstrated. The fixed versions are 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older no longer get an official fix.
The PHP project also published temporary mitigations, but said plainly that none of them make an installation safe. The only real fix is the update.
An AI agent that knows the servers
The most important work was done before that day. I keep everything about my servers in one git repository. Each server has its own document covering its role, software, how to connect and past problems. The same place holds the connection instructions and the reports from earlier security incidents. Secrets stay out of git.
The repository is the AI agent's workbench. When I ask it to do something on a server, it first reads that server's document and then checks the machine's actual state, because documentation goes stale but the server always tells the truth. When the work is done, the agent updates the documents and records what happened. The next job starts where the last one left off.
That is what made the day work. The agent didn't have to guess which machines run PHP or where their packages come from. It knew.
The security layer: the agent doesn't act on its own
AI on production servers sounds like a risk, and it would be without limits. That's why the agent works inside a few layers:
- No access without me. The agent isn't a service running somewhere in the background. It only works inside a session I start on my own computer. When I close the session, the agent can no longer reach the servers, and nothing is left on them acting on its behalf. Even that day's hourly check lived only inside that session.
- Its own, identifiable key. The agent connects to the servers with its own SSH key, separate from my personal one. The server's login log shows when the agent connected, and its key can be removed without touching my own access.
- Read-only by default. The agent's working rules say it reads and checks first, and every change to production needs my approval. The inventory, the version checks and the site sweep are all read operations. On the server management API the agent has read-only access by default. Write access sits on a separate key, used only for jobs agreed on separately.
- Approval for every step. The agent proposes, I decide. That day I approved the plan in the morning, the temporary mitigation and the new package source separately in the afternoon, and the Node.js updates in the evening. Every proposal came with its reasoning.
- Everything is recorded. Every change ends up in version control and in the incident report, so afterwards you can see what was done, when and why.
Morning: inventory and preparation
At 8:11 on Wednesday morning the agent went through all fifteen servers and built a picture of the situation. PHP was installed on thirteen of them, and on eleven it served websites. Two ran PHP only on the command line, so the vulnerabilities didn't apply to them.
The inventory also turned up two things that would otherwise have gone unnoticed. One server was two releases behind, because its automatic updates didn't cover the source its PHP packages come from. Another still had PHP 8.1 command-line tools installed, although that version no longer gets fixes. Both were sorted out in a few minutes, before the actual fix had even been released.
Finally the agent wrote an update script and scheduled it to check every hour whether fixed packages were available yet. The script upgrades only the PHP packages on a server, restarts the PHP processes and reports which version is running. I approved the plan that morning: the script could install PHP updates and nothing else, and the agent asked separately about everything beyond that.
Afternoon: getting the fix out
The fix was released at around 17:00. Debian's security updates reached the mirrors within the same hour, and by 17:14 the first five servers were patched, including all three Debian machines. I had expected the Debian machines to be last; they were first.
On six Ubuntu servers it was harder. Their package source hadn't published the fixed versions yet, and at times it didn't respond at all. At this point the agent proposed two things, and I approved each one separately:
- It applied the temporary mitigation recommended by the PHP project on all six servers, which closes the confirmed attack path for one of the vulnerabilities. The settings were tested before the restart. Two other recommended settings, removing the memory limit and lowering the form size limit, were deliberately left out because they could have broken sites.
- It found a second distribution channel from the same packager that already had the fixed packages. Before enabling it, the agent checked that the signing key was exactly the same as on a server that already used that source.
By 17:40 the last server was patched. The agent then requested every site on those six servers, 98 in total, and went through the responses. The only anomalies were old ones unrelated to the update. Not a single site broke.
A finding I could easily have missed
An updated package doesn't yet mean a patched server. If a web server process was already running before the update, it can keep using the old, vulnerable code even though the new version is on disk. The package manager reports success, and everything looks done.
The agent didn't settle for the package manager's word. It checked on every server which version the running processes actually use. It found one such case, and a restart fixed it. The update script now handles that automatically as well.
This is exactly where "package updated" and "server safe" part ways.
The same evening: Node.js
The same day Node.js released its own security updates. The most serious allowed code execution through the Brotli decompressor. From 22:00 that evening the agent updated eight servers in about a quarter of an hour. Along the way it turned out that one real-time app had been running on an already-deleted Node.js binary since August, and that one server was still on Node 20, which is no longer supported. Both were fixed.
What I took away
The AI didn't do anything I couldn't have done myself. It did all of it faster, in parallel and without getting tired – and wrote every step down. By the end of the day I had an incident report with a timeline, every server's versions and every deviation with its reasoning.
Three things made it possible:
- Documentation before the rush. The agent is only as good as what it knows about the environment. The per-server documents and earlier incident reports were in place before the warning came.
- Preparation before the release. The advance notice gave less than a day. With the inventory, the clean-up of old versions and a ready update script, all that was left at release time was the update itself.
- Checking after the update. A version number isn't enough. What matters is what the running process actually uses, and whether the site responds.
In closing
A critical vulnerability doesn't wait for a good moment. For a small operator it has meant a choice: a whole evening hopping from server to server, or the risk that some machine stays unpatched. An AI agent that knows the environment takes that choice away. I decide what gets done, and the agent does it on every machine at once and writes down every step.