CVE-2026-126714: phpAfterShell – A New Chapter in PHP Remote Code Execution

CVE-2026-126714: phpAfterShell – A New Chapter in PHP Remote Code Execution


PHP has another security problem to deal with, and this time the issue goes deeper than an ordinary application vulnerability.

On November 19, 2026, the PHP development team released a series of security updates addressing 17 security vulnerabilities, including seven critical, four high-severity and six medium-severity issues.

The headline vulnerability, CVE-2026-126714, popularly referred to as phpAfterShell, affects PHP’s default file-based session handling and can potentially lead to remote code execution.

However, focusing exclusively on phpAfterShell would miss the bigger picture. The same security release addresses weaknesses involving session serialization, PHP-FPM request processing, memory management, use-after-free conditions and XML processing.

For organisations running PHP-powered applications, this is a runtime security update that deserves immediate attention.

phpAfterShell: When a Session Write Becomes an Attack Vector

PHP sessions are fundamental to how web applications maintain state across HTTP requests.

Authentication information, shopping cart details, user preferences and other application data can be maintained through session storage.

By default, PHP uses a file-based session handler.

CVE-2026-126714 exposes a weakness in how this handler updates existing session files.

Instead of clearing the previous session contents before writing updated data, PHP can leave a partially overwritten session file if the write is interrupted at a particular point.

An attacker who can influence session data and trigger the right sequence of events may be able to introduce attacker-controlled serialized objects into that file.

When another request subsequently invokes session_start(), PHP reads and processes the affected session data.

If the application contains a suitable object gadget chain, this can potentially result in remote code execution under the privileges of the PHP worker.

The vulnerability is particularly relevant to applications using session upload progress, although the underlying issue concerns the file-based session handler.

The important point is that this is not simply a matter of submitting a malicious upload. The exploitation chain depends on influencing session data and interrupting a session-file write at the appropriate moment.

The Other Critical Vulnerabilities

The November release addresses six additional critical vulnerabilities alongside phpAfterShell.

CVE-2026-115560 – Session Serializer Mismatch

This vulnerability involves inconsistent session serialization configurations.

An attacker can potentially manipulate multipart upload data so that session information is interpreted using an unexpected serialization format.

Under suitable application conditions, this can introduce attacker-controlled objects into session processing, potentially resulting in code execution where a suitable gadget chain exists.

It also creates the possibility of session corruption and denial of service.

This is particularly important for environments where multiple applications or PHP-FPM pools share session storage.

CVE-2026-129289 – PHP-FPM Request Smuggling

PHP-FPM is widely deployed to process PHP requests behind web servers and reverse proxies.

The vulnerability concerns the handling of unread request-body data when persistent FastCGI connections are reused.

Under affected conditions, leftover bytes from one request can be interpreted as another FastCGI request.

This creates a request-smuggling opportunity that can potentially bypass front-end request handling assumptions and lead to execution of attacker-controlled PHP code.

Organisations using PHP-FPM with persistent FastCGI connections should pay particular attention to this issue.

CVE-2026-129496 – Timezone Cache Use-After-Free

This vulnerability involves memory management in PHP’s timezone cache.

Under specific conditions involving diagnostic logging, PHP can retain a reference to memory that has already been released.

Subsequent operations can access the freed memory, potentially resulting in memory corruption, application crashes or code execution.

CVE-2026-129481 – Use-After-Free During Session Shutdown

Another session-related vulnerability involves incomplete cleanup when session shutdown is interrupted.

The resulting use-after-free condition can leave PHP with references to memory that is no longer valid.

This can potentially lead to memory corruption and code execution.

It is also significant in the context of the earlier PHP2Shell security fixes, as this advisory addresses an incomplete fix associated with CVE-2026-109619.

CVE-2026-129474 – Use-After-Free in Magic Method Backtraces

PHP’s magic methods are automatically invoked during specific object operations.

This vulnerability involves memory handling during backtrace generation around these methods.

Under affected circumstances, accessing released memory can result in memory corruption and potentially code execution.

CVE-2026-129182 – Use-After-Free in Fatal Error Backtraces

The final critical issue concerns memory management during fatal error backtrace generation.

A use-after-free condition can occur in the affected processing path, potentially resulting in memory corruption and application instability.

These vulnerabilities demonstrate that the November release is not limited to session management. Several internal PHP runtime operations also required security corrections.

Beyond the Critical Vulnerabilities

The release also addresses high- and medium-severity vulnerabilities across PHP components.

Among the additional issues are:

  • CVE-2026-129291: A use-after-free vulnerability involving PHP-FPM epoll handling.
  • CVE-2026-129292: Cross-site scripting involving the PHP-FPM status interface.
  • CVE-2026-129538: An out-of-bounds access vulnerability involving PHP-CGI PATH_INFO handling.
  • CVE-2026-129501: A double-free vulnerability in DOM XML serialization.
  • CVE-2026-129506: An additional security issue addressed in the November release.
  • CVE-2026-129438, CVE-2026-128090, CVE-2026-128064, CVE-2026-127960, CVE-2026-15353 and CVE-2026-48841: Other advisories included in the release.

The complete set of 17 advisories should be reviewed against the official PHP security announcements and changelogs rather than assessing exposure based only on the critical vulnerabilities.

The Connection With October’s PHP2Shell

The November release becomes more interesting when viewed alongside the October security updates.

On October 21, PHP released fixes for two critical vulnerabilities:

CVE-2026-109618 involved remote code execution through improper handling of out-of-memory conditions.

CVE-2026-109619 involved stale global state and memory references that could survive request cleanup, potentially enabling remote code execution.

These vulnerabilities were collectively discussed under the PHP2Shell reporting.

The November release also addresses CVE-2026-115560 and CVE-2026-129481, demonstrating that the security work around session processing and runtime memory management did not end with the October patches.

This is an important lesson for vulnerability management teams.

Applying an earlier security update does not automatically protect an environment against subsequently identified weaknesses in related code paths.

The PHP runtime needs to be reassessed against the latest security release.

Affected Versions and Security Updates

PHP published the following releases on November 19, 2026:

  • PHP 8.2.36
  • PHP 8.3.37
  • PHP 8.4.28
  • PHP 8.5.13
  • PHP 8.6.0

Organisations should upgrade to the appropriate patched release for their PHP branch.

PHP 8.2 is approaching end of life on December 31, 2026. Organisations using this branch should also plan their migration to a longer-supported version.

What Should Security Teams Do?

This release should trigger a review of the PHP runtime footprint, not merely a patching exercise for one application.

Runtime discovery: Identify PHP installations across production servers, containers, web applications, cloud workloads and managed hosting environments.

Session configuration: Review session.save_handler, session.serialize_handler and session.upload_progress.enabled. Ensure applications sharing session storage use compatible serialization configurations.

PHP-FPM exposure: Review FastCGI connection reuse, PHP-FPM listeners, worker configurations and status endpoint exposure.

Application security: Identify applications that deserialize session objects or allow untrusted data to influence session contents.

Patch management: Upgrade PHP runtimes, rebuild container images, redeploy workloads and restart affected PHP-FPM workers.

Detection and monitoring: Review unusual session activity, unexpected worker crashes, PHP error logs, suspicious multipart uploads and anomalous FastCGI traffic.

Where immediate patching is not possible, disabling session upload progress can reduce exposure to relevant session-related attack paths. Configuration-specific mitigations are also available for some of the other vulnerabilities.

These measures are temporary safeguards. They do not replace the vendor’s security updates.

Exploitation Status

Public reporting has identified proof-of-concept material for CVE-2026-126714 and CVE-2026-115560.

However, public proof-of-concept availability should not be confused with confirmed exploitation in the wild.

The vulnerabilities deserve prioritisation because of their potential impact, particularly where internet-facing PHP applications are involved.

Organisations should also check the CISA KEV catalogue for subsequent additions rather than assuming that the absence of an entry means an issue is not exploitable.

The runtime is part of the attack surface. If the runtime is vulnerable, the security of everything running on top of it deserves another look.

The October PHP2Shell vulnerabilities were a warning. The November phpAfterShell release is another reason to treat runtime security as an ongoing vulnerability management responsibility.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.