Is Amazon Linux 2023 affected by PHP2Shell?
Yes, until you install the updated packages. AL2023 ships PHP as versioned packages, php8.1 to php8.5, per its PHP documentation, and the builds before 21 October 2026 predate the PHP2Shell fix (CVE-2026-109618 and CVE-2026-109619). AWS’s security bulletin says customers running PHP on Amazon Linux should apply the updated packages. The upstream fixed releases are:
| Branch | First fixed release |
|---|---|
| PHP 8.2 | 8.2.35 |
| PHP 8.3 | 8.3.36 |
| PHP 8.4 | 8.4.27 |
| PHP 8.5 | 8.5.12 |
| 8.1 and older | No new release; official source patches for 7.4, 8.0 and 8.1 |
How do I check which PHP package my instance runs?
Ask dnf first: sudo dnf list installed 'php*' shows each PHP package with its full version, and the release ending tells you whether it’s the fixed build. php -v only reports the command-line binary. The website runs through PHP-FPM, so also check it from the web side: AWS’s LAMP tutorial uses a temporary phpinfo() page and tells you to delete it afterwards, and php_sapi_name() reports fpm-fcgi. See the check PHP version guide.
Has Amazon Linux shipped a PHP2Shell fix?
Yes, for php8.2 to php8.5. The Amazon Linux Security Center rates the updates Important and lists them for 22 October 2026; the repository metadata dates them 21 October:
| Package | Advisory | Fixed version |
|---|---|---|
| php8.2 | ALAS2023-2026-3301 | 8.2.35-1.amzn2023.0.1 |
| php8.3 | ALAS2023-2026-3302 | 8.3.36-1.amzn2023.0.1 |
| php8.4 | ALAS2023-2026-3303 | 8.4.27-1.amzn2023.0.1 |
| php8.5 | ALAS2023-2026-3304 | 8.5.12-1.amzn2023.0.1 |
| php8.1 | None | No Fix Planned |
The release notes for 2023.12.20261021 list these same php8.2 to php8.5 versions. Status per package is on the ALAS pages for CVE-2026-109618 and CVE-2026-109619. When we checked, the CVE-2026-109619 page still showed php8.5 as “Pending Fix” even though ALAS2023-2026-3304 lists both CVEs in the repository data; we treat php8.5 8.5.12-1.amzn2023.0.1 as fixed but expect the page to catch up.
How do I update PHP on Amazon Linux 2023?
AL2023 locks each instance to the repository version it was built from, as AWS’s deterministic upgrades guide explains, so move to the fixed release explicitly:
sudo dnf check-release-update
sudo dnf upgrade --releasever=2023.12.20261021
The first command lists available releases; the second shows the package changes and asks you to confirm. A later release also includes the fix. For new instances, launch from the latest AL2023 AMI, which AWS says always carries the newest packages. For container images, rebuild from the updated Amazon Linux 2023 base image.
How do I restart PHP-FPM and verify the fix?
Restart PHP so workers load the new code: sudo systemctl restart php-fpm, and sudo systemctl restart httpd if Apache serves the site, as in AWS’s LAMP tutorial. Then run sudo dnf list installed 'php*' again and look for the amzn2023.0.1 builds in the table, check the web side, and enter the version in the PHP version checker.
What if I can’t update yet?
Use PHP’s stopgaps, such as turning off session.upload_progress.enabled and lowering post_max_size, then restart php-fpm. AWS’s bulletin also lists AWS WAF rules as compensating controls; see PHP2Shell on AWS. Neither is a fix; limits are on the CVE-2026-109618 workaround page.
What about php8.1 or Amazon Linux 2?
ALAS marks AL2023’s php8.1 “No Fix Planned”, so move those sites to php8.2 or later. On Amazon Linux 2, core php is also “No Fix Planned”, and the PHP 8.2 Extras entry showed “Fixed” (ALAS2PHP8.2-2026-015) on one CVE page but “Pending Fix” on the other when we checked. See PHP end of life, the PHP2Shell patch guide and the PHP2Shell checker.
I ran dnf upgrade but PHP didn't change on Amazon Linux 2023. Why?
AL2023 locks its repositories to the release your AMI was built from, so a plain dnf upgrade may not see newer packages. Run sudo dnf check-release-update, then upgrade with --releasever set to 2023.12.20261021 or later.
Is Amazon Linux 2 covered by this page?
No. On Amazon Linux 2, the core php package is marked No Fix Planned, and the PHP 8.2 Extras status was inconsistent between the two CVE pages when we checked. Check the Amazon Linux Security Center for your package, or move to AL2023.
Check your PHP for PHP2Shell
Enter the version your website reports. We compare it with the first fixed release for its branch and tell you what to do next.
PHP2Shell checker →Sources
The core facts on this page (fixed versions, CVE details, vendor packages and agency warnings) come from official sources. Research, news and community posts are labelled as such.
- Security Bulletin 2026-143-AWS: PHP CVE-2026-109618 and CVE-2026-109619Vendor AWS
- Security advisory: Critical remote code execution vulnerabilities, update nowOfficial The PHP Group
- RCE via OOM corruptionOfficial The PHP Group
- RCE via stale global stateOfficial The PHP Group
- php_sapi_nameOfficial The PHP Group
- PHP in AL2023; Tutorial: Install a LAMP server on AL2023Vendor AWS
- Amazon Linux 2023 version 2023.12.20261021 release notesVendor AWS
- CVE-2026-109618 / CVE-2026-109619 (ALAS explorer)Vendor AWS (Amazon Linux Security Center)
- Deterministic upgrades through versioned repositories on AL2023Vendor AWS
- Install LAMP on Amazon Linux 2023Vendor AWS
- CVE-2026-109619 (Amazon Linux)Vendor Amazon Linux Security Center