Upvantix

Guides ·

PHP2Shell on AWS: find every PHP runtime, patch or isolate end-of-life versions, and use AWS WAF as a stopgap after CERT-In's critical alert

PHP2Shell is two critical unauthenticated remote code execution flaws in PHP. This guide covers how to find every PHP runtime in your AWS accounts, upgrade or isolate end-of-life versions, use AWS WAF as a stopgap, review logs from 17 October 2026, and answer CDSL's request to depository participants.

By Upvantix team

PHP2Shell is two critical flaws in PHP itself, CVE-2026-109618 and CVE-2026-109619, that let an unauthenticated request run code on a server. Mitigation on AWS starts with an upgrade: per the PHP security advisory, 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released 21 October 2026, fix both. PHP 8.1 and older get no new release.

CERT-In vulnerability note CIVN-2026-0510, issued 21 October 2026, rates the flaws critical. In CERT-In's words: "Multiple reports confirm large scale exploitation in the wild". It advises users to patch urgently. On 22 October, CDSL asked depository participants to report related incidents and declare end-of-life PHP, with upgrade or isolation plans.

Amazon Threat Intelligence saw a PHP2Shell exploitation attempt against its MadPot honeypots on 17 October, four days before disclosure, so review logs from that date.

On AWS: inventory PHP on EC2, containers, Lambda custom runtimes, Elastic Beanstalk and Lightsail; upgrade, or isolate what you cannot upgrade; put the AWS WAF PHP application managed rule group in front as a stopgap only; and keep the logs CERT-In requires for 180 days.

What PHP2Shell is, in six dated lines

  • 17 October 2026: Amazon Threat Intelligence records an exploitation attempt against its MadPot honeypots.
  • 21 October 2026: PHP releases fixed versions; AWS says the embargo lifted at 14:00 UTC.
  • 21 October 2026: CERT-In issues CIVN-2026-0510, severity critical.
  • 22 October 2026: CDSL issues its communique to depository participants.
  • 22 and 23 October 2026: AWS adds PHP2Shell rules to its WAF managed rule group (versions 2.3, then 2.4).
  • 23 October 2026: PHP flags a third flaw, CVE-2026-115560, not fixed by the 21 October releases.

CVE-2026-109618 corrupts memory when PHP runs out of memory mid-request. CVE-2026-109619 lets one request leave stale data that a later request on the same worker reuses. Both are reached through multipart (file upload) request handling before application code runs, says AWS; PHP rates the risk highest for mod_php.

Who is affected

PHP says every installation serving web requests is at risk: PHP-FPM, mod_php, php-cgi, FrankenPHP and LiteSpeed. AWS Security Bulletin 2026-143-AWS lists 8.2.0 to 8.2.34, 8.3.0 to 8.3.35, 8.4.0 to 8.4.26 and 8.5.0 to 8.5.11 as affected, and 5.4 to 8.1 as end of life with no upstream release.

Sound application code does not help; the flaws are in PHP. That includes platforms built on PHP such as WordPress, Drupal, Joomla and Magento, and, as The Times of India notes, commercial applications and embedded software components that use PHP.

AWS says its own services are not impacted, but customers' PHP on them can be.

On scale in India, CloudSEK, as reported by The Times of India, counted about 19,500 Indian internet-facing services showing end-of-life PHP versions on Shodan. These are counts of services that expose a PHP version, not confirmed vulnerable sites, and distribution backports can leave an old version number in place.

Step 1: find every PHP runtime in your AWS accounts

  1. EC2. Turn on Systems Manager Inventory for all managed nodes and filter the Applications list for php packages. Also run php -v through Run Command, because source builds may not show as packages.
  2. AWS Config. Record managed instance inventory to keep that history.
  3. Amazon Inspector. It lists PHP among supported languages for EC2 and Amazon ECR image scanning.
  4. ECS, EKS and Fargate. Check base images and rebuild on a fixed PHP.
  5. Lambda. There is no managed PHP runtime, so check every custom runtime and container image. Bref users should follow Bref's security release.
  6. Elastic Beanstalk. Fixed PHP platforms for 8.2 to 8.5 apply in the next weekly window if managed platform updates are on.
  7. Lightsail. AWS cannot update running instances in place; create new ones from updated blueprints and migrate.
  8. Amazon Linux has updated packages, says AWS. Elsewhere, check changelogs: Kaspersky notes distributions may ship fixes without changing the version number, as reported by The Economic Times.
  9. Easy to miss: Amazon EMR on EC2 clusters with Ganglia on releases 4.2.0 to 6.15.0, vendor appliances and Marketplace AMIs that bundle PHP.

Record account, Region, resource, version, exposure, owner and action (patch, isolate, retire) for each.

Where PHP runs on AWSHow to find itHow to fix itWatch out for
EC2Systems Manager Inventory, AWS Config, php -vInstall fixed packages or build, restart workersSource builds may not show as packages
ECS, EKS, FargateBase images, ECR scanningRebuild on a fixed PHP and redeployImages outside ECR
LambdaFunctions with custom runtimes or imagesRebuild the runtime or image, redeployNo managed PHP runtime
Elastic BeanstalkEnvironment platform versionManaged platform update or manual updateUpdates wait for the maintenance window
LightsailInstances from PHP blueprintsNew instance from an updated blueprint, then migrateNo in-place update

Step 2: patch, or isolate end-of-life PHP you cannot patch yet

Supported branches: upgrade, then restart every worker.

End-of-life PHP, 8.1 and older, has no upstream release. PHP published minimal source backports for 7.4, 8.0 and 8.1 for people building from source; some distributions and LTS vendors offer backports. PHP does not say which flaws its source backports cover, and AWS says no fix for CVE-2026-109618 is available on end-of-life branches. Treat them as exposed and migrate. PHP 8.2 security support ends on 31 December 2026, so 8.2 buys only about two months. Choose the target branch now; if the upgrade means changing or moving the application, see Cloud Migration & Modernization.

Isolate what you cannot upgrade yet: security groups, private subnets, or an authenticated proxy or VPN. CERT-EU advised isolating internet-facing PHP applications from public networks if needed, as reported by The Economic Times.

Interim settings from PHP and AWS: session.upload_progress.enabled=0, which also covers CVE-2026-115560; fatal_error_backtraces=0 on PHP 8.5; memory_limit=-1, set so applications cannot override it, with an external memory cap in place, such as a container or cgroup limit or ECS task memory, because -1 removes PHP's own limit; a low post_max_size; and pm.max_requests=1 if performance allows. PHP says these reduce exposure to specific attack paths but do not make an installation safe.

Step 3: AWS WAF as a stopgap, not a fix

AWS says patching is the only complete fix; AWS WAF reduces exposure meanwhile. From the AWS WAF guidance for PHP2Shell:

  • Add the PHP application managed rule group, AWSManagedRulesPHPRuleSet, to the web ACL in front of each PHP workload on CloudFront, Application Load Balancer or API Gateway.
  • The default version has both rules: PHP2Shell_BODY for CVE-2026-109619 and PHP2Shell_BODY_Extended for CVE-2026-109618. If pinned, move to Version_2.4 or later. Check the group is not overridden to Count.
  • Add Core rule set SizeRestrictions_BODY (blocks bodies over 8 KB), scoped so it stays off endpoints that legitimately take larger uploads.
  • Block multipart/form-data where the application takes no uploads, and rate-limit POST requests.
  • Turn on WAF logging, start new rules in Count, then Block.

Limits: AWS WAF cannot see PHP worker memory or server configuration. Body inspection stops at 8 KB on Application Load Balancer, and at 16 KB by default (up to 64 KB) on CloudFront and API Gateway. Header amplification inside multipart parts can stay under size caps, so upload endpoints remain at risk.

Attack pathAWS WAF coverageServer-side action
Request patterns for CVE-2026-109618Yes, PHP2Shell_BODY_Extended, version 2.4 or laterUpgrade PHP
Request patterns for CVE-2026-109619Yes, PHP2Shell_BODY, version 2.3 or laterUpgrade PHP
Session upload progress fieldYes, PHP2Shell_BODY, version 2.4 or latersession.upload_progress.enabled=0
Multipart upload pathYes, if the application takes no uploadsUpgrade PHP
Out-of-memory from an oversized bodyPartial; header amplification can stay under the capmemory_limit and post_max_size settings, with an external memory cap
Repeated attempts on one workerPartial; rate limits reduce volumepm.max_requests=1
fatal_error_backtraces on PHP 8.5Nofatal_error_backtraces=0
Invalid INI diagnosticsNoRemove invalid per-request settings

Step 4: logs and detection from 17 October

Amazon Threat Intelligence says to investigate from at least 17 October. Look for:

  • POSTs carrying PHP_SESSION_UPLOAD_PROGRESS, and repeated multipart POSTs.
  • PHP fatal errors, out-of-memory errors and timeouts on upload routes.
  • Unexpected process execution or file changes on web servers.

Use AWS WAF, load balancer, CloudFront, web server and PHP-FPM logs in Amazon CloudWatch Logs. AWS says the IP addresses it published are shared anonymisation infrastructure, so investigate matches rather than just blocking them. If a worker may be compromised, rotate secrets it could reach; see CERT-In's AI-agents advisory on AWS.

In India, CERT-In's Directions require logs kept for a rolling 180 days and specified incidents reported within 6 hours; see CERT-In log retention on AWS. Depository participants and stockbrokers also report to their depository or exchange; see SEBI CSCRF on AWS.

How to answer CDSL's request

CDSL communique CDSL/IS/DP/POLCY/2026/742 asks depository participants, in its words:

  • "Please confirm in case your systems have experienced any related active exploits, anomalies, or security incidents to dpinfosec@cdslindia.com"
  • "Indicate if any End-of-Life (EOL) PHP versions are currently in use within your organization and outline the remediation measures being taken to upgrade or isolate them"

A practical reply structure (our suggestion, not a CDSL template):

  1. Inventory scope and date.
  2. PHP instances by branch.
  3. End-of-life instances, each with action and target date.
  4. Interim controls: WAF rule group version, server settings.
  5. Log review from 17 October and its outcome.
  6. Owner.

CDSL set no deadline. This is not legal advice. Banks and NBFCs can reuse the structure for their own auditors; for commercial banks, see RBI cyber security directions on AWS.

How Upvantix helps

Upvantix is an AWS Select Tier Services Partner providing AWS-focused consulting and managed services. Our AWS security review covers security posture and architecture, and configuration, logging and detection, producing a risk-ranked remediation and optimization backlog, then approved implementation and validation. See also ongoing AWS operations and patching. We do not provide emergency incident response, forensic investigation or legal advice, and we do not file with CDSL or CERT-In for you.

Talk to us about a PHP exposure review of your AWS accounts.

Common questions about PHP2Shell on AWS

What is PHP2Shell?

PHP2Shell is the name for two critical flaws in PHP, CVE-2026-109618 and CVE-2026-109619, that can let an unauthenticated attacker run code on a server. PHP released fixes on 21 October 2026, and CERT-In rates the flaws critical in vulnerability note CIVN-2026-0510.

Which PHP versions fix PHP2Shell?

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix both flaws. Restart every PHP worker after the upgrade. PHP 8.1 and older get no new release from the PHP project. AWS says no fix for CVE-2026-109618 is available on end-of-life branches, so plan a move to a supported branch.

Does AWS WAF protect against PHP2Shell?

AWS WAF reduces exposure but does not fix PHP2Shell. The AWSManagedRulesPHPRuleSet group, at the default version or Version_2.4 or later, includes rules for both flaws. AWS says patching is the only complete fix. Applications that accept uploads remain at risk, because header amplification inside multipart parts can stay under size limits.

Is AWS itself affected by PHP2Shell?

AWS says its services are not impacted. Customers running affected PHP versions on EC2, Lambda custom runtimes, Elastic Beanstalk, Lightsail or Amazon EMR on EC2 with Ganglia could be. AWS has released fixed Elastic Beanstalk platforms, but running Lightsail instances cannot be updated in place.

How do I find PHP versions across my AWS accounts?

Use Systems Manager Inventory to list PHP packages on managed nodes, AWS Config to keep that history, and Amazon Inspector for EC2 and ECR images. Then check by hand what those miss: PHP built from source, Lambda custom runtimes and container images, Lightsail instances and EMR clusters running Ganglia.

What should I do if I run PHP 8.1 or older?

Plan to migrate to a supported branch. In the meantime, use a distribution or LTS vendor backport, or PHP's minimal source backports if you build from source, but do not treat the branch as fixed. Remove public exposure where you can, apply the interim settings and put AWS WAF in front.

From what date should I review logs for PHP2Shell?

Review logs from at least 17 October 2026. Amazon Threat Intelligence saw an exploitation attempt against its MadPot honeypots on that date, four days before public disclosure. Look for POST requests carrying PHP_SESSION_UPLOAD_PROGRESS, repeated multipart POSTs, PHP fatal errors and unexpected process or file changes.

What did CDSL ask depository participants about PHP?

In communique CDSL/IS/DP/POLCY/2026/742 of 22 October 2026, CDSL asked depository participants to confirm any related exploits, anomalies or security incidents to dpinfosec@cdslindia.com, and to indicate whether any end-of-life PHP versions are in use, with the measures taken to upgrade or isolate them. It stated no deadline.

Does CERT-In require incident reporting if PHP2Shell is exploited?

CERT-In's Directions require specified cyber incidents to be reported within 6 hours, and ICT system logs to be kept for a rolling 180 days within Indian jurisdiction. Confirm with your compliance team whether an incident falls within the listed types. This is general information, not legal advice.

Discuss your AWS workload

Bring your AWS questions into focus.

Share your current workload, architecture questions and the decision you need to make.