Web Analytics
Magento Security

One security patch, five stores, one day

Every Adobe patch is tested on our own copy of each store first. September’s emergency patch went on within the week. When one store’s build later failed because a patch had been applied twice, we replaced the patching script with one that applies each patch exactly once, put it on every other store, and October’s patch went on five stores in a day.

Situation

An emergency patch from Adobe, and a lesson a month later

In September Adobe published an emergency security patch for a critical Magento vulnerability. Every Magento store we look after needed it, and needed it quickly, without anything else changing.

We applied it to each store that week: tested on our own copy of the store first, then released. So far, so routine.

What we found

The patch was fine. The way patches are commonly applied was not.

A month later one store’s build failed with an error nobody had seen before. The patch itself was correct. The script that applied it ran every time the store’s code was installed, and one part of the patch could be applied twice without complaint. Each install added the same line again, until Magento refused to start.

The failure happened on our copy of the store, not the live one, which is the point of having a copy.

What we did

Apply each patch exactly once, everywhere

  • A patch script that remembers Each patch is recorded as applied, per file, and left alone on the next install. A patch that only half-applies is rolled back rather than left in place.
  • The same script on every store The fix went on every other store we look after before any of them hit the problem, not just the one that failed.
  • October’s patch as the test When Adobe’s monthly patch came out, it went on five stores in a day using the new script, each one tested on our copy and then released.

Result

Patched, and still patched after the next deployment

Within the weekSeptember’s emergency patch on every store

5 stores, 1 dayOctober’s monthly patch

0live stores affected by the double-apply fault

Two things we took from it. “Patched” is not the end of the job: the patch has to survive the next deployment too. And a problem found on one store should be fixed on all of them.

Worth checking on your store

Two questions for whoever looks after it

  • Which Adobe security patch is your store on, and when was it applied? The answer should be a date, not “recently”.
  • Is the patch applied by a script that runs on every deployment? If so, what stops it applying twice?