Back to writing

When a runtime vulnerability is not in your code

The recent PHP2Shell disclosures made me think again about a difficult but ordinary fact of software work: an application can be carefully written and still run on a vulnerable layer below it.

I do not take this as a reason to blame one language, or to pretend that PHP, Node.js or Java are interchangeable risks. The useful question is broader: when a runtime or bundled dependency is exposed, do we know where it is running, how to update it, and how to prove the fix reached production?

Some risks arrive before application code

PHP2Shell is the name used for two critical PHP runtime vulnerabilities, CVE-2026-109618 and CVE-2026-109619, disclosed on 21 October 2026. They can allow unauthenticated remote code execution in PHP installations that serve web requests. For the wider context, AP’s report on the disclosure and patch response is a useful overview. The important point for me is where the fault sits: in runtime request handling, before an application’s own validation or authorisation rules necessarily have a chance to help.

The operational guidance is concrete. The NCSC-NL tracker lists patched PHP releases and advises teams to find their internet-facing PHP runtimes, apply a fixed vendor package, update bundled images and restart the affected workers. WAF rules can reduce exposure while that happens, but even their guidance is clear that they are defence in depth, not a substitute for the patch.

That distinction matters. The controls I use to protect a route—strict request validation, parameterised database queries, authentication and authorisation—are still worth having. They do not repair a memory-safety flaw in the runtime that is processing the request.

Start with an inventory, not a guess

My first response to an advisory is to make the affected surface visible. That means the deployed runtime version, the base image, the framework distribution, background workers, scheduled jobs and third-party products that bundle the runtime. A repository dependency file is useful, but it is not the whole inventory.

The same habit applies to Node.js and Java. A Node application may inherit risk through Node itself, a bundled native library or a container base image. A Java service has its JDK, application dependencies, build plugins and possibly an application server. The right fix depends on the advisory, so I do not assume that updating one package manager file has updated the software actually handling traffic.

The recent response guidance from Microsoft’s security team makes this practical: manually installed or bundled runtimes, including PHP, Node.js, Java and container images, still need the owner to act. A host update does not necessarily fix a self-contained image already built and deployed.

Patch, redeploy, then verify the running thing

For a critical internet-facing issue, I prioritise supported fixes and a small, deliberate deployment path. I want to know which version is fixed, whether the project is on an end-of-life branch, what needs rebuilding, and what will restart. If an application cannot move immediately, I record the temporary mitigation, its owner and its expiry rather than quietly treating it as a permanent solution.

  • Patch the runtime or vendor package on a supported release.
  • Rebuild the container or deployment artefact that actually contains it.
  • Redeploy and restart the processes that loaded the older runtime.
  • Confirm the version from the running environment, then keep watching the relevant logs and advisories.

If there is reason to think exposure happened, patching is only the first part of the response. The next steps depend on the system, but can include reviewing access and application logs, preserving evidence, checking for unexpected changes, and rotating secrets that may have been reachable. The aim is to make a decision from evidence, not to turn every alert into a ritual of random changes.

AI can help with the work, not own the incident

I use AI to make the first pass faster: summarising an advisory beside its primary source, finding likely references in a repository, drafting an inventory checklist, or suggesting tests that confirm a rebuilt image uses the expected runtime. It is useful for reducing the blank-page time during a busy response.

I keep firm boundaries around it. I do not paste credentials, private logs, customer data or unredacted configuration into a general prompt. I do not let an agent apply patches, change firewall rules or deploy to production without a scoped permission and human approval. And I do not treat a confident summary as a source. The affected versions, exploit conditions and upgrade path still come from the vendor or a trusted advisory, checked by someone accountable for the service.

This is the same principle I use in day-to-day AI work: the tool can accelerate research and drafts, but it does not remove the need to understand the system or review the result. My normal workflow with AI still ends with a human review; during a security response, that final responsibility matters even more.

A quieter security habit

PHP2Shell is a sharp reminder because the issue was below the application and updates were urgent. The larger lesson is calmer: security is not a one-time property of a codebase. It is an ongoing practice of knowing what is deployed, staying on supported versions, applying the right fix promptly, and being honest about the limits of temporary layers.

That is the habit I want across PHP, Node.js, Java and the tools around them. Not panic, and not false reassurance—just a repeatable path from an advisory to a verified, reviewable change.

Working on something similar? Let's talk