Threat Intelligence

PHP Patches Seven Critical Flaws, Including a Session Bug That Can Lead to Remote Code Execution

The Hacker News · 20 Nov 2026
Key Takeaway If your website or web application runs on PHP, ask your developer or host to update to the latest 8.2, 8.3, 8.4 or 8.5 release this week.

The PHP Foundation has released security updates for multiple critical flaws that could be exploited to achieve remote code execution on affected servers. The maintainers gave advance notice that all supported PHP versions are affected under specific conditions, such as non-default configurations or uncommon setups. Successful exploitation could also lead to session corruption, denial of service, memory corruption or local privilege escalation.

One of the flaws, named "phpAfterShell" by researchers at Depthfirst, is described as critical and can let a remote attacker run arbitrary code on affected servers. It targets how PHP writes session data to disk. If a file update is interrupted, because the PHP worker dies mid-write or just after writing but before the old content is cleared, the session file can end up mixing two different sessions: the start of the new one and the tail of the old one.

Researcher Yuhang Wu explained that an attacker can choose the length fields in the new data so that leftover bytes, previously just part of an ordinary string, are read as separate session entries and serialized objects. Nothing needs to be processed during the upload itself. The attacker leaves the right bytes on disk and waits for the application to call session_start(), at which point PHP loads the modified session and deserializes those objects. Chained with a memory-corruption issue in a PHP-native class, this leads to remote code execution.

The issue affects any application running an affected PHP version with file-based sessions. Patches are available, and users of the 8.2.x, 8.3.x, 8.4.x and 8.5.x branches are advised to update to the latest version. Where immediate patching is not possible, the advice is to turn off session upload progress.

Why it matters

Many small businesses run PHP through content management systems or hosted web apps and assume that only default, internet-facing features are risky. This flaw shows that an interrupted file write, an ordinary event, can corrupt session state and turn trusted server-side data into an attack path. Anyone using file-based sessions is exposed, and the maintainers' warning that all supported versions are affected means no current branch is safe to leave as is.

What to do

  • Update PHP to the latest release on the 8.2.x, 8.3.x, 8.4.x or 8.5.x branch.
  • Turn off session upload progress if you cannot patch immediately.
  • Identify which applications use file-based sessions, as these are the ones affected by phpAfterShell.

Summarised by CISO AI from The Hacker News, written with Claude Sonnet 5.5. We link back to every original so you can read it yourself.