AWS Advanced Tier Services Partner Contact

Article

PHP2Shell and Java4Shell: two pre-auth RCEs in a month, and how to shut them down on AWS

PHP2Shell (CVE-2026-109618/109619) and Java4Shell (CVE-2026-114938) are unauthenticated RCEs in the PHP and Java runtimes. What they are, who is exposed, and how to close them on AWS.

A wall of clear glass blocks in a dark navy space, one block fractured with a thread of red light passing through it

In the space of a month, two of the runtimes that most of the web is built on shipped emergency fixes for unauthenticated remote code execution. On 21 October 2026, PHP patched the pair known as PHP2Shell. On 17 November 2026, OpenJDK patched Java4Shell. Both let an attacker who has never logged in run code on your server. If you run PHP or Java on AWS, both are your problem this quarter, and this is what we are telling the teams we operate for.

A quick note on the name, because it causes confusion: PHP2Shell is occasionally written “PGP2Shell” in secondhand coverage. It has nothing to do with PGP or GnuPG. It is a flaw in the PHP interpreter itself.

This article is defensive. It explains what each flaw is, which systems are exposed, and the order to fix them in. It contains no exploit code.

The two at a glance

 PHP2ShellJava4Shell
CVECVE-2026-109618 and CVE-2026-109619CVE-2026-114938
Disclosed21 October 202617 November 2026
ComponentPHP core runtimeOpenJDK HotSpot JVM
SeverityCVSS v4.0 9.2 (critical)CVSS v4.0 9.2 (Calif); CVSS 3.1 8.1 high (Oracle)
Root causeMemory-safety bugs in request handlingHeap out-of-bounds write in the Base64 decoder
PreconditionAny PHP serving web requestsx86-64 CPU with AVX-512 VBMI; OpenJDK 17.0.6+
Auth requiredNoneNone, in the cases Calif demonstrated
Exploited in the wildYes, attempts reportedNot confirmed at disclosure

PHP2Shell: the interpreter, not your code

PHP2Shell is two vulnerabilities, CVE-2026-109618 and CVE-2026-109619, both rated 9.2 of 10 under CVSS v4.0. The important part is where they live: in the PHP engine itself, not in WordPress, Laravel, or any plugin. If PHP serves your site, patching your application does nothing for this.

The clearest of the pair, CVE-2026-109618, is a memory-corruption bug in how PHP cleans up after a request that runs out of memory. If a request hits the configured memory_limit at the wrong moment, PHP can leave internal data half-built and later treat it as if it were valid. An attacker who can nudge a server to that edge can turn the leftover state into code execution. The PHP team groups several related memory-safety defects under the two CVE numbers.

It is unauthenticated, and under mod_php it can be triggered before any of your application code runs. PHP-FPM, php-cgi, FrankenPHP and LiteSpeed builds are affected as well. The fix landed in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35; branches older than those, including the long tail of 5.x and 7.x still in production, are affected and will not all receive patches.

Two things about the real-world risk, kept honest. Details leaked about two days before the coordinated release, and exploitation attempts were seen before the patch was public, so this was a race from day one. At the same time, researchers at Sansec note that a reliable attack needs specific knowledge of the target and specific conditions on it, so blanket mass exploitation is harder than the headline suggests. Neither observation changes the instruction: patch now. Amazon's own threat intelligence has reported broad probing, and at least one campaign chained PHP2Shell with a Linux kernel flaw to reach root on network appliances.

Java4Shell: a fast path that wrote too far

Java4Shell, CVE-2026-114938, was disclosed by the research firm Calif on 17 November 2026, and Oracle and the OpenJDK project shipped fixes the same day. Oracle scored it 8.1 (high) on CVSS 3.1; Calif rates it 9.2 (critical) on CVSS 4.0. The gap is about how each group weighs the preconditions, not about whether it is serious.

The bug is in a performance optimisation. On modern x86-64 chips, the JVM swaps its ordinary Base64 decoder for a hardware-accelerated version that processes many bytes at once. For certain malformed, padded inputs that routine miscalculates how much to write and spills past the end of its buffer, corrupting the heap next to it. Calif turned that fixed overwrite into a heap leak they call JavaBleed, and then into remote code execution, by carefully arranging memory around the decoder.

What makes Java4Shell narrower than PHP2Shell is its preconditions. It only affects OpenJDK 17.0.6 and newer, and only on x86-64 processors with AVX-512 VBMI support, which covers recent Intel Xeon (Ice Lake and later) and AMD EPYC and Ryzen (Zen 4 and later). ARM64 is not affected, so Java workloads on AWS Graviton are outside this one, and neither Java 8 nor Java 11 is affected. Because Base64 decoding sits under so many protocols, though, the reachable surface is large: Calif demonstrated unauthenticated code execution against default installations of Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate.

Every distribution built from OpenJDK inherits the flaw, including Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, Red Hat build of OpenJDK and Oracle Java SE. At disclosure there was no public exploit and no confirmed exploitation in the wild, which is the window you want to patch inside rather than after.

There is one more detail worth sitting with. Both bugs had been reported publicly months earlier, as ordinary crash reports, and sat unpatched until a researcher showed they could be weaponised. Java4Shell was surfaced again with the help of an AI code-audit tool. The lesson for defenders is that “it only crashes, it is not exploitable” is an assumption with a short shelf life.

What to do on AWS, in order

The two flaws want the same response, so here is the sequence we run.

  1. Find every affected runtime first. You cannot patch what you cannot see. AWS Systems Manager Inventory and Amazon Inspector will enumerate PHP and Java across every account and surface the versions, including the Java buried inside a vendor appliance or a container base image.
  2. Patch, worst-exposed first. Update Amazon Linux PHP packages to a fixed release, and move Amazon Corretto to its November 2026 security update (see the AWS security bulletin). Start with internet-facing identity, CI/CD and collaboration systems, which is exactly where Java4Shell was shown to be pre-auth.
  3. Buy time at the edge while you patch. For PHP, AWS published AWS WAF rules that blunt the known trigger and oversized request bodies. For Java, if you cannot update immediately, start the JVM with -XX:-UseBASE64Intrinsics to disable the hardware decoder, or -XX:UseAVX=2 on x86-64 hosts. Treat both as a stopgap, not a fix: a WAF rule and a JVM flag reduce exposure, they do not remove the vulnerability.
  4. Use the preconditions to triage Java. Java on Graviton (ARM64), and on Java 8 or 11, is not exposed to Java4Shell, so those fleets drop down your list. Patch them on the normal cycle; spend the emergency hours on x86 with AVX-512.
  5. Watch for the attempts. PHP engine errors that fire before application code, oversized multipart bodies, and the malformed Base64 trigger are all detectable. Amazon GuardDuty, CloudTrail and your web-server logs are where to look, and PHP2Shell is already being probed.
  6. Assume one host might already be hit, and check your recovery. Confirm that backups are current and that a tested restore exists, so that if a server was compromised before you patched, rebuilding it is a known procedure rather than an improvisation.

Where ElectroMech fits

This is the work our security threat and response and managed services practices do under an agreed SLA: inventory the estate, patch it in the right order, put WAF and detection in front of it, and keep the recovery path tested. If you are not sure which of your AWS workloads are exposed to either flaw, or you want a second pair of hands through the patch window, talk to an AWS practice lead. A Well-Architected review is the longer answer: it is how you stop finding out about your runtime inventory during an incident.

For related reading, see our write-ups on AWS WAF and the Bank of Baroda breach.

Keep reading

AWS S3 Complete Guide (2026)

AWS S3 complete guide for developers — storage classes, bucket setup, security, lifecycle policies, and cost tips. 20 years of S3, mastered.

18 March 2026

Next step

Tell us what you are trying to move, modernise or automate

A short call with an AWS practice lead, not a sales qualification call. You will leave with a candid read on the work involved and the order to do it in.

Talk to an AWS practice lead
Call us
+91 75748 77958
Email
inquiry@electromech.cloud
Response time
Within 24 business hours