PHP2Shell on AWS: WAF Rules, Beanstalk, Lightsail and Amazon Linux
AWS security bulletin 2026-143-AWS (updated October 30, 2026) and the AWS WAF Managed Rules changelog cover PHP2Shell (CVE-2026-109618 and CVE-2026-109619) across AWS. AWS added managed PHP2Shell rules to AWSManagedRulesPHPRuleSet (updated to v2.5 on November 4) and shipped patched runtimes for Elastic Beanstalk, Lightsail, CodeBuild and Amazon Linux.
Short answer: enable AWSManagedRulesPHPRuleSet on its default version (or static version 2.5+) so PHP2Shell_BODY and PHP2Shell_BODY_Extended are active and set to Block. WAF rules only reduce exposure while you roll out updates: upgrade PHP to 8.5.12, 8.4.27, 8.3.36 or 8.2.35.
PHP2Shell AWS WAF rules: managed rule group v2.5
| CVE | AWS WAF managed rule | History & notes |
|---|---|---|
| CVE-2026-109619 | PHP2Shell_BODY in AWSManagedRulesPHPRuleSet | Added October 22, 2026 in static version 2.3; inspects request bodies for CVE-2026-109619 patterns. |
| CVE-2026-109618 | PHP2Shell_BODY_Extended in AWSManagedRulesPHPRuleSet | Added October 22, 2026 in static version 2.4, superseding the initial stopgap advice to rely on SizeRestrictions_BODY (8 KB cap) in AWSManagedRulesCommonRuleSet. |
| Both CVEs | AWSManagedRulesPHPRuleSet static version 2.5 | Released November 4, 2026 with improved detection signatures for both CVE-2026-109618 and CVE-2026-109619. |
Customers using the default version of AWSManagedRulesPHPRuleSet receive these updates automatically. If you have not enabled the PHP managed rule group yet, or if you pinned an older static version (2.2 or earlier), update your web ACL and check the official AWS bulletin 2026-143-AWS.
How to enable or verify PHP2Shell protection in AWS WAF
- Open your web ACL: AWS WAF console → Web ACLs → the web ACL attached to your CloudFront distribution, Application Load Balancer or API Gateway.
- Add or check
AWSManagedRulesPHPRuleSet: under Rules, add the PHP application managed rule group (100 WCU) if it is missing, and confirm neitherPHP2Shell_BODYnorPHP2Shell_BODY_Extendedis overridden to Count. - Check version pinning: if your rule group is pinned to a static version, move it to 2.5 (or switch to Default so future signature updates apply automatically).
- Test uploads and forms: test in Count mode briefly if your application sends unusual multipart payloads, then enforce Block.
- Subscribe to updates: subscribe to the AWS Managed Rules SNS topic in
us-east-1for future rule group revisions.
Capacity: the PHP managed rule set uses 100 WCU (Core rule set uses 700 WCU, Known Bad Inputs 200 WCU). A web ACL over 1,500 WCU costs extra.
What AWS WAF does not cover
- Direct traffic. WAF only inspects requests through CloudFront, Application Load Balancers, API Gateway, App Runner, Amplify and the other resources it can attach to. An EC2 or Lightsail instance reached on its public IP, or behind a Network Load Balancer, gets no WAF inspection.
- Large bodies on ALB. An Application Load Balancer only lets WAF inspect the first 8 KB of a request body by default. CloudFront and API Gateway default to 16 KB, configurable up to 64 KB.
- The vulnerability itself. AWS stresses that upgrading PHP is the only complete fix.
PHP2Shell on Elastic Beanstalk, Lambda, CodeBuild and EMR
Elastic Beanstalk: AWS released AL2023 PHP platform version 4.13.13 across all supported branches (PHP 8.2, 8.3, 8.4 and 8.5) with the upstream fixed releases (8.2.35, 8.3.36, 8.4.27 and 8.5.12). Environments with Managed Platform Updates enabled receive it in their maintenance window; others must update the platform version manually.
Lambda, CodeBuild and EMR: AWS Lambda has no native PHP runtime, so redeploy custom PHP runtimes or container images (if you use Bref, upgrade to Bref's October 2026 security release). AWS CodeBuild began rolling out updated curated images with PHP 8.2.35–8.5.12 on October 30, 2026. On Amazon EMR on EC2, releases 4.2.0–6.15.0 launched with Ganglia are affected; omit Ganglia or upgrade to EMR 7.x (EMR on EKS and EMR Serverless are not affected).
PHP2Shell on Lightsail
Updated Lightsail blueprints are now available in all regions, but AWS cannot update running Lightsail instances in place. Either migrate to a new instance created from an updated blueprint, or update packages on your existing instance:
- Take a snapshot of the instance.
- On Lightsail OS/application blueprints using distribution packages, run
sudo apt update && sudo apt upgrade, then restart Apache or PHP-FPM and confirm withphp -v. - On Bitnami blueprints, PHP lives in
/opt/bitnami/phpand is not updated by apt; AWS recommends creating a new instance from the updated blueprint and migrating your site.
Amazon Linux PHP2Shell packages
| Platform | Package | Advisory |
|---|---|---|
| Amazon Linux 2, PHP 8.2 Extra | php-8.2.35-1.amzn2.0.1 | ALAS2PHP8.2-2026-015 |
| Amazon Linux 2023 | php8.2, php8.3, php8.4, php8.5 | ALAS2023-2026-3301 to 3304 |
| Amazon Linux 2 core php, AL2023 php8.1 | No fix planned | Move to a supported PHP |
On Amazon Linux 2 run sudo yum update php; on Amazon Linux 2023 run sudo dnf upgrade. Then restart PHP-FPM or Apache. For other distributions see Ubuntu, Debian and RHEL.
Attacks seen by AWS
Amazon's threat intelligence team reported the first PHP2Shell attempt against its MadPot honeypots on October 17, 2026, four days before public disclosure, with more attempts on October 21, and CISA added both CVEs to the KEV catalog on October 26. See is PHP2Shell exploited in the wild for full details, and Cloudflare and PHP2Shell for how Cloudflare's default rules compare.
PHP2Shell AWS FAQ
Does AWS WAF have a PHP2Shell rule?
Yes. AWS added PHP2Shell rules to AWSManagedRulesPHPRuleSet on October 22, 2026 (v2.3 added PHP2Shell_BODY for CVE-2026-109619; v2.4 added PHP2Shell_BODY_Extended for CVE-2026-109618, superseding the earlier SizeRestrictions_BODY stopgap) and updated the signatures in v2.5 on November 4, 2026.
Is AWS itself affected by PHP2Shell?
AWS says its services are not impacted; Amazon WorkMail was upgraded to PHP 8.3.36 with no customer action needed. Customer PHP workloads on EC2, Lightsail, Elastic Beanstalk, Lambda custom runtimes, Containers or older EMR clusters with Ganglia (4.2.0–6.15.0) remain your responsibility.
Will the AWSManagedRulesPHPRuleSet update reach me automatically?
Yes, if your web ACL uses the default version of AWSManagedRulesPHPRuleSet. If you pinned the rule group to a static version, update it to version 2.5 (or later) to get PHP2Shell_BODY and PHP2Shell_BODY_Extended.
Does AWS WAF protect an EC2 instance?
Only traffic that passes through a resource with the web ACL attached, such as CloudFront, an Application Load Balancer or API Gateway. Requests sent straight to the instance's public IP are not inspected.
Which Amazon Linux packages fix PHP2Shell?
Amazon Linux 2 PHP 8.2 Extra is fixed in php-8.2.35-1.amzn2.0.1 (ALAS2PHP8.2-2026-015). Amazon Linux 2023 has advisories ALAS2023-2026-3301 to 3304 for php8.2 to php8.5. AL2 core php and AL2023 php8.1 have no fix planned.