Skip to content
Free since 2015. Built for the engineers who keep things running.

cat /articles/php2shell-using-aws-transform-to-move-legacy-php-onto-a-patched-runtime.md

Security

PHP2Shell: Using AWS Transform to move legacy PHP onto a patched runtime

A walkthrough for using AWS Transform to find legacy PHP code, upgrade it to PHP 8.4 or 8.5, and then patch the runtime against the PHP2Shell flaws that let outside callers run code on a server.

AWS DevOps Blog16 Nov 2026 · 8 min read · summary

article --summary

The summary

The PHP2Shell pair of flaws in the PHP engine lets an unauthenticated caller execute code on any server handling PHP requests, and CISA has already listed both as known exploited. PHP 8.2 through 8.5 have fixed releases that install without code changes, but PHP 8.1 and older will never get a patch, so those applications must move to 8.4 or 8.5 first. Legacy code often breaks on newer PHP, which makes the upgrade the real obstacle. The guide walks through three stages: continuous modernization scans your repositories for end-of-life runtimes, a managed transformation rewrites the code and checks it on a patched PHP, and you then update and restart the runtime itself. A sample PHP 7.4 application shows the kinds of breakage to expect, including removed functions and silent behavior changes that only tests reveal. You need the AWS Transform CLI, Docker or a patched PHP, and a disposable machine, because the agent runs commands unattended.

Editorial note: This is a summary of an article first published by AWS DevOps Blog. The full piece is on their site.

Reading now

Topic
Security
Source
AWS DevOps Blog
Published
16 Nov 2026
Format
Curated summary

Have a take on this?

Write it up and submit it. It goes on the list once an editor approves it.

Submit an article

articles --latest

Latest articles

New from the blogs we follow and the community.

All articles

newsletter --weekly

DevOps Weekly, minus the noise.

The best reads, new jobs and upcoming events, in one email a week.