OpsCanary
awslambdaPractitioner

PHP2Shell: Safeguarding Legacy PHP with AWS Transform

5 min read AWS DevOps BlogNov 16, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

Legacy PHP applications are facing serious security risks due to critical vulnerabilities in the PHP engine, specifically CVE-2026-109618 and CVE-2026-109619. These vulnerabilities allow unauthenticated users to execute code on any server handling PHP requests. As PHP versions reach their end of life, it's crucial to transition to a patched runtime to protect your applications and data. AWS Transform provides a structured approach to modernize your PHP applications, ensuring they remain secure and functional.

The PHP2Shell solution operates in three clear steps. First, it continuously analyzes your repositories to identify end-of-life runtimes and other technical debts. This is followed by a managed transformation that upgrades your code based on the findings and validates it on a patched PHP runtime. Finally, you will need to patch and restart the runtime itself, which is essential for remediating the identified CVEs. To get started, you’ll need an AWS account, the AWS Transform CLI, and a few other prerequisites like Node.js and Git.

In production, you should be aware that PHP 8.2 reaches its end of life on December 31, 2026, and PHP 8.3 follows on December 31, 2027. This timeline is critical for planning your upgrades. Make sure to run the necessary commands to analyze your codebase and address any findings promptly. The process can take some time, especially the comprehensive tech-debt analysis, so plan accordingly to avoid disruptions in your workflow.

Key takeaways

  • →Use AWS Transform to analyze your legacy PHP repositories for vulnerabilities.
  • →Follow the three-step process: analyze, transform, and patch your PHP runtime.
  • →Ensure your environment meets prerequisites like AWS credentials and the AWS Transform CLI.
  • →Monitor PHP version end-of-life dates to maintain application security.
  • →Run comprehensive tech-debt analyses to identify critical issues before they escalate.

Why it matters

In a production environment, failing to address these vulnerabilities can lead to severe security breaches, risking data integrity and application availability. Transitioning to a patched runtime is not just a best practice; it's a necessity for safeguarding your applications.

Code examples

Bash
git clone https://github.com/aws-samples/aws-transform-custom-samples
Bash
atx ct analysis run --type tech-debt-comprehensive --source my-php --wait # 5 to 10+ minutes
Bash
sudo dnf install -y --releasever=2023.12.20261021 php$TARGET-cli php$TARGET-xml php$TARGET-mbstring composer

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
DigitalOceanSponsor

Simple, affordable cloud — VMs, Kubernetes, and managed databases in minutes. Trusted by 600,000+ developers. Spin up a Droplet in 60 seconds.

Try DigitalOcean →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.