PHP2Shell timeline

Emergency patching in the age of AI: best practices

26 October, 2026

In AppSec preparation is 99% of the battle

October 20th, PHP.net has published an advanced notice of two critical vulnerabilities in the PHP engine. PHP is the technology that powers the world wide web as 70% of the websites are running on PHP. As opposed to many organizations out there, we have a healthy skepticism towards raw CVE severity scores. Ever heard of the story “The Boy Who Cried Wolf”? Various publications have demonstrated that the centralized database of all vulnerabilities (NVD) contains significant noise with very inconsistent severity scoring. So every vulnerability report runs through our triaging process that involves analyzing several factors that can help us assess the risk. The PHP2shell vulnerability was immediately flagged as no existing control could stop it and the loss magnitude was maximal. So early in the morning on October 21st we started preparing for “emergency patching”.

In this blogpost, we will describe a key set of emergency patching best practices that made our day relatively straightforward.

  • Threat intelligence and a risk-based triaging process.
  • Up-to-date and easily accessible asset inventory.
  • Risk profiles with key risk scenarios.
  • Automation to build and deploy in a secure manner.
  • Clearly defined roles and responsibilities within the team.
  • Regular incident response simulations.
  • Communication protocols and ready-to-go mail templates to notify all stakeholders and customers.
  • Regular security training for everyone in the team.

AI is changing the patching discipline

Frontier AI models can find vulnerabilities and weaponize them in minutes. We had heard this, and we may even have seen some examples, so we knew we had to seriously reduce our patching turnaround times. However, October 21st, 2026 was the day the new reality hit us with hard numbers: we had to patch within minutes, on very short notice!

A brief recap of events

PHP2Shell timeline
PHP2Shell timeline

The PHP project announced two critical vulnerabilities that let attackers run code on a server before the application even starts. PHP maintainers reacted swiftly and prepared a patch for release the next day. However, a security research firm predicted that mass exploitation would begin within 15 minutes of the patch, because the patch itself would reveal how to craft an exploit.

This is exactly where AI changes the game: the turnaround time to build an exploit. What used to take days or months of manual work can now be done in minutes with frontier AI models.

To make things worse, Chainguard released its patched images hours before the official patch, giving attackers an early look at the fix. Around the same time, Cloudflare reported that exploitation had already started, several hours before any patch was available. Emergency game on!

Emergency patching protocol

Imagine professional firefighters asleep in their station in the middle of the night. An alarm wakes them: there is a fire. Everyone on the team knows exactly what to do. They have established protocols and procedures, and they have trained for this. Now replace “fire” with “vulnerability” and “professional firefighters” with “team Codific”. We knew exactly what we had to do. We had our list of assets, automation to build and deploy, responsible team members with well-defined roles, communication protocols, risk profiles, etc.

The essentials of patching are not really changing in the age of AI. If anything, patching is getting easier. During a crisis there are always small details your simulations missed. This is where your favorite LLM can quickly help you out. For instance, we used it to write scripts that check whether the patch was correctly applied, because in the rush it is easy to overlook a critical detail. What AI does change is the notice period and the time you have to patch. Preparation is most of the battle, and on October 21st, 2026, it paid off massively for our team. Once the patched base images were available, all our systems were patched within 1.5 hours, and our forensic analysis found no evidence of a breach. You can read the full timeline here.

Key security activities for patching in the age of AI

Asset inventory

Asset inventory
Asset inventory

Everything starts with a clear view of what you have and where. A detailed, up-to-date asset inventory is a must-have. You can’t manage what you don’t know! Quite frankly, we put together our first asset inventory about 10 years ago, when we were getting ready for our very first ISO 27001 certification audit. I had no idea what it should look like. But frankly, it doesn’t matter as much what it looks like. What matters is having the following key elements in place.

  • Your asset inventory is as up-to-date as possible. 100% is really hard to reach. For instance, during recent events we found 2 staging assets that weren’t listed. That’s why you need regular checks built into other activities (e.g., patching, backup checks, onboarding, offboarding) to keep the inventory updated.
  • Key stakeholders in your team can find the asset inventory in under 60 seconds, so make sure the right shortcuts are in place. Slack bookmarks are my favorite!
  • The list is a single source of truth, but it’s easy to copy and use as a checklist. We use our asset inventory for periodic patching, backup checks and other operational activities. So being able to pull an up-to-date version into a spreadsheet is very handy. Honestly, I wouldn’t try to come up with an overly complicated master sheet with all possible use cases in there.
  • Each asset has a clearly defined owner.
  • Each asset has a criticality label. For instance, our WordPress websites are not as critical as our crown jewels.

Threat intelligence

Once you know what your assets are you need to track any emerging threats to your assets.

The first step with threat intelligence is to collect intelligence from the right sources. Here is a non-exhaustive list of typical sources you should follow:

  • Vulnerability feeds: NVD/CVE, EUVD (ENISA’s vulnerability database, relevant under the CRA), and CISA’s Known Exploited Vulnerabilities (KEV) catalog.
  • Exploitation signals: your WAF or CDN vendor’s notices (Cloudflare flagged php2shell attacks early) and researcher and threat-intel firms.
  • Community and early warning: national CERTs (CERT-EU, CCB in Belgium) and security social media.

Once you have that in place, you need to match incoming advisories against your assets. In other words, is a specific threat relevant? More importantly, what is the potential loss magnitude for a specific threat? So threat triaging is a challenge. In this blog, I won’t go into the depths of triaging. I’ll just mention that it was more than obvious that PHP2shell carried maximum risk for our organization.

Application risk profiles

risk scenarios
Risk scenarios for a sample application

Most people think about risk as High / Medium / Low. That is fine for an asset criticality label, but risk analysis is a more advanced topic. The approach I’d recommend is FAIR (Factor Analysis of Information Risk). FAIR is well thought out and is one of the few approaches with solid science behind it.

At this point you might say: “Oh god, I have heard of that. Quantitative risk analysis is too complex, we’re not doing that.” That’s understandable. However, what you absolutely need is a list of the threat events you fear the most. I like to call them risk scenarios. Risk scenarios allow teams to quickly zoom in on the most feared events. In all honesty, we still work with High/Medium/Low, though we are shifting towards a quantitative approach to get a dollar value.

So, back to our emergency patching. After Cloudflare reported seeing exploitation attempts, we had to make a swift decision about taking our systems offline. “Better safe than sorry” sounds good on paper, however, some of our products have high availability needs. So taking them offline would literally costs us money. With the risk scenarios in place, we could make a rational decision about which systems to take offline. For instance, keeping a WordPress website that holds no customer data online is a good call. Even if the loss event frequency was high, the loss magnitude was acceptable.

Build and deploy automation

This one is trivial. You should automate your build and deploy pipelines. However, there are some gates you should put in place to make sure you don’t end up with more risk.

The build pipeline should be entirely automated, but it should contain security checks. Break the build if a critical vulnerability is present in the codebase or in its SBOM. Modern SAST and SCA tools let you integrate those checks seamlessly into the pipeline. You should also have automated unit and integration tests to catch regressions in functionality and, more importantly, in security. Together, these checks make sure the patch does not break any functionality or introduce new vulnerabilities.

Your production deploy pipeline should be automated too, but obviously not everyone should be able to launch a deploy. Launching it should require someone with a dedicated role. From that launch decision onwards, however, everything should be completely automated.

Once those key ingredients are in place, patching is relatively straightforward: apply the patch, build and deploy. In the case of php2shell, it came down to rebuilding our containers on the updated base images, which bumped PHP to a patched version, and then rerunning the entire build and deploy automation.

Clearly defined roles and responsibilities

Clearly defined roles and responsibilities will save you a lot of headaches when a crisis hits. They are one of the key ingredients of preparation. Rehearsing crises through tabletop exercises, or even full crisis simulations run as a game, might feel tedious, but it pays off. Trust me!

At this point you might wonder how on earth you can prepare for every possible event. Emergency patching is a reasonable one to prepare for, since it will happen more and more. But here is a tip – every crisis is unique, yet many crises share common elements.

For instance, you might have prepared for a server being wiped out entirely, for example because a data center is destroyed. We have actually prepared for this scenario, since some of our customers in the Middle East are hosted in data centers in Dubai. That preparation includes clear roles for communicating the incident, a procedure to set up a secondary server from backup, and forensic capabilities on standby. Those building blocks are reusable. The php2shell response needed several of them. We communicated with customers during the crisis, took instances offline, brought them back once patched, and stood ready to restore from backup had we found signs of exploitation.

Security training

preparation vs action
Time spent in preparation vs actual action

Here is an analogy for security training and how seriously you should take it. Consider a professional athlete in a sport such as Hyrox. The athlete spends most of their time training, and competition takes up only a small portion of it. Now contrast that with our daily work. We expect our teams to remember an OWASP Top 10 training they took two years ago during onboarding.

A great training program should be continuous. Obviously, we cannot expect our teams to spend more time on training than on their actual job, and that’s where my analogy breaks down. However, security training should be a regular activity. Our sales team, for instance, has a monthly cybersecurity awareness training covering various topics. In fact, I’d argue that the choice of topics matters less than the awareness itself.

Emergency patching activities in OWASP SAMM

Emergency patching vs OWASP SAMM
Emergency patching activities in OWASP SAMM

OWASP SAMM is an open maturity model for measuring and improving your application security program. It brings together best practices across the full spectrum of application security, from governance to operations.

With the rise of agentic AI, some argue that frameworks like SAMM are losing relevance. Our experience on October 21st suggests the opposite. Nearly every activity that let us patch all our systems that fast is firmly rooted in SAMM. AI shortened the time we had to respond. It did not change what we needed to have in place.

The figure above maps our emergency patching activities onto the SAMM model. Two of them, asset inventory and threat intelligence, have no dedicated stream in SAMM, but they appear in several activities across the model, from application risk profiles to patching and dependency management.

Conclusion

In October 2026, PHP disclosed two AI-flagged vulnerabilities, CVE-2026-109618 and CVE-2026-109619. Known as “php2shell”, they allow unauthenticated remote code execution. In plain language, attackers can easily abuse them to take full control of the server a PHP application runs on. While much of the world scrambled, our team was well prepared for this type of event. We patched all affected assets within 90 minutes of the patched base images becoming available. Looking back, and despite several hours of downtime for some of our systems, we believe the patching process went as smoothly as it could. In the age of AI, the time to respond keeps shrinking, so preparation is what makes the difference.

Author

For the past 15 years Aram has been involved in application security as a researcher, industry expert, and core contributor to the OWASP SAMM project. Aram is the founder and CEO of Codific, a Belgian cybersecurity product firm. At Codific, he works at the intersection of software engineering and application security, helping organizations build secure and reliable systems that protect what matters most. Aram holds a PhD in application security from DistriNet KU Leuven, which gives him a broad understanding of the security landscape. His work on refining and streamlining the LINDDUN privacy engineering methodology has been incorporated into both ISO and NIST standards. Aram is also a core contributing member of the OWASP SAMM project, which is the industry standard framework for managing application security programs.

Related Posts