Skip to content
All work

Incident Review: A Day-Zero PHP Flaw

A critical PHP flaw went public, one copy of PHP on the fleet sat behind a public webmail page with no vendor patch, and nothing scheduled noticed. This is the review, including the part that went wrong.

Category
Security & Response
Role
Declared and owned the incident; designed the response org
Stack
Cloudflare WAFWazuhPHPDockercPanelIncident board
What it proves
  • Found, declared, contained and closed the same afternoon, with no sign the vulnerable code was ever reached.
  • Patched where a patch existed within hours, and held at the edge where one didn't.
  • Every action item in the review names the check that now covers it.
  • The miss, that no scheduled check caught it, is written into the review and the compliance record, and it's why the fleet now has an hourly vulnerability monitor and a two-hour rule.

The problem

Most incident write-ups on portfolio sites are stories where everything went right. This one has a timeline I'm proud of and a cause I'm not. The flaw was found by hand, in a chat session, a couple of hours after it went public. No scheduled check flagged it.

That's on the page because the fix for it is the most useful thing the incident produced.

What was exposed

The advisory covered two PHP release lines running on the fleet. One was the control panel's own PHP on the hosting server, which wasn't reachable from the internet, and the customer sites there were on fixed builds a little over an hour after the advisory. The other was inside the mail server's vendor container, behind the public webmail page, and the vendor hadn't shipped a patched image yet. Host patching doesn't reach PHP inside a vendor's container, so autopatch couldn't help.

That one was the real exposure. The tempting quick fix was to block the admin pages. The responder who mapped the request paths found that webmail, calendar sync and mobile mail all call PHP on every request, so blocking the admin pages would have changed nothing.

The response

I declared a Sev2 and froze the affected hosts, so routine automation would leave them alone. From there the agent in the incident commander seat ran it. It staffed four responders from the org, each with one question: has anyone exploited it, which paths reach PHP, can the edge control be bypassed, and can the hosting server be patched now.

Incident log · worked example

Timeline, from the advisory going public

Times are hours and minutes after the advisory was published.

  1. +0:00Advisory public. Nothing scheduled compares the fleet's PHP versions with new advisories.
  2. +1:10Customer PHP on the hosting server already on fixed builds through routine patching.
  3. +2:44A manual sweep finds the mail server's PHP below the fixed version. Incident declared, Sev2, hosts frozen, NOC paged.
  4. +2:56Compromise check: no requests to the vulnerable code path, no errors, no new processes or files since the advisory.
  5. +3:01Origin check: the mail server drops all traffic that doesn't come through Cloudflare, on both IP families, so any edge rule covers every path.
  6. +3:04Hosting server's panel PHP updated, snapshot taken first, every customer site content-checked after.
  7. +3:52The full fix, putting webmail behind an access login, would cut users off, so it's held as a decision for me. The AI incident commander doesn't wait on it. It asks the security guardian for an interim control: a WAF rule that matches the exploit's request shapes.
  8. +3:56Rule created in log-only mode to check it against real traffic.
  9. +4:08Rule switched to block. Every known exploit shape gets a 403. Normal webmail, autodiscover and mobile sync still pass.
  10. +4:22Security lead signs the close on paper with re-test evidence. Freeze lifted. The vendor's patched image landed later that day.

About four hours of exposure from the advisory to the block, an hour and forty minutes from declaration to close, no outage, and no evidence the vulnerable code was ever reached.

What went wrong

No scheduled check compared the PHP running on the fleet, in containers or not, with the fixed versions in new advisories. The exposure was found by hand. The compliance seat logged that as a continuous-monitoring failure in the security program's record, which is where it belongs.

The interim control should have come first. The full fix needed a business decision because it would cut users off, and the edge rule only went in when the incident commander asked for it about an hour into the response. The review's rule now: when the full fix needs a decision, put an interim control in place at once.

Closing the incident also closed two responder tasks that still held open questions for me, and dropped the questions. The incident commander caught it and re-filed them, and the close command was fixed so it can't happen again.

Every action item ships a check

The fleet's rule is that a review can't end in a to-do list. Each action item has to name the check that covers it, a task that will build one, or a written reason it can't be checked, or the invariant suite goes red a week later. This review's items:

  • PHP versions against advisories

    A scheduled check now compares every PHP build on the fleet, on hosts and inside containers, with the fixed versions in known advisories. It's an invariant, so it pages.

  • The edge rule can't quietly disappear

    If the WAF rule is deleted or switched off block, it pages. The same work fixed two gaps in the origin's lock that the incident turned up.

  • A tripwire behind the edge

    An origin-side check watches for exploit shapes reaching the mail server anyway, which would mean the edge rule had been bypassed.

  • Incident close keeps open questions

    A code fix with a regression test. A responder task holding a question for me stays open after the incident closes.

  • Deploys restart only their own service

    A deploy during the freeze would have restarted more than its one service. The deploy script now compares every container's start time and fails if anything else restarted.

What changed after

The same day, I ordered an hourly vulnerability monitor that reads public advisory feeds and matches them against what's actually installed and running on the fleet. A Vulnerability Manager seat now takes each finding from "a feed said so" to fixed and re-scanned.

Two weeks later the policy got a two-hour rule: a known-exploited or critical, internet-facing vulnerability can't stay exposed more than two hours after the monitor first sees it. In that time it's fixed, mitigated with evidence, proven a false positive, or accepted in writing by me. An invariant checks the clock.

The calls I made, and what each one cost.

  1. D01

    Contain at the edge first, patch when the patch exists.

    The vendor hadn't shipped a fix, and the origin only accepted traffic from the edge, so a signature rule there covered every path in minutes without cutting anyone's email.

  2. D02

    Log mode before block mode, even under pressure.

    Twelve minutes of watching real traffic is cheap insurance against a rule that blocks every user's webmail along with the attacker.

  3. D03

    Map the request paths before choosing the fix.

    The obvious fix, blocking the admin pages, would have looked like progress and changed nothing. One responder took a few minutes to prove that before anyone chose it.

  4. D04

    Write the miss down where an auditor will read it.

    A finding that only lives in a chat log gets repeated. In the compliance record, it has an owner and a fix date.

More systems
Get in touchNot looking

Questions about how this works?

I'm not looking for a new role, but I'm happy to talk about toil, alert noise and incidents that never quite close.

Get in touch