How did someone attack PHP four days before anyone was supposed to know?

The fix was under embargo. The first attack attempt was not.

Security flaws are normally handled like a surprise party. The few people who know keep quiet, the fix is prepared, and everyone is told on the same day. That day for PHP was meant to be 21 October at 14:00 UTC.

Then the timeline gets strange. Amazon's honeypots caught an attack attempt on 17 October, from an address linked to a commercial anonymising network. On 20 October the PHP project told people to get ready for patches the next day, and added that they might come earlier if details got out. And then, around 02:00 UTC on 21 October, the first working exploit code appeared. Twelve hours before the embargo ended.

So who leaked it?

Nobody knows. Amazon says it "remains unclear" how the attacker got the information. Public reports of the flaws also appeared before the patch, but the sources do not say who published them first. And Amazon cannot tell whether those early attempts would have worked on real systems.

Surely this was an AI that cracked it independently, right? That would be the dramatic version.

It would, and there is no evidence for it. Nothing in the reports says AI was involved on the attacking side. The boring explanation is far more likely: a secret known to researchers at several firms, maintainers, vendors and agencies is a secret with many doors. Each extra person in the circle is another place it can slip out.

That is the quietly worrying part. The technology did its job. The finding was done cleanly and early. What failed was the old human machinery of keeping a secret for a few weeks, and that machinery is about to be tested far more often.