{"id":50372,"date":"2026-11-19T21:52:05","date_gmt":"2026-11-19T16:22:05","guid":{"rendered":"https:\/\/www.getastra.com\/blog\/?p=50372"},"modified":"2026-11-19T21:52:14","modified_gmt":"2026-11-19T16:22:14","slug":"cve-2026-126714","status":"publish","type":"post","link":"https:\/\/www.getastra.com\/blog\/security-advisory\/cve-2026-126714\/","title":{"rendered":"PHPafterShell (CVE-2026-126714): Critical PHP Session RCE Fix"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TLDR\"><\/span>TLDR;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>phpAfterShell (CVE-2026-126714) is a remote code execution flaw in PHP\u2019s file-based session storage.<\/li>\n\n\n\n<li>The PHP project rates it <strong>9.2 (Critical)<\/strong> on CVSS v4.0 and published patches on November 19, 2026.<\/li>\n\n\n\n<li>Fixed in PHP <strong>8.5.13, 8.4.28, 8.3.37, and 8.2.36<\/strong>. <\/li>\n\n\n\n<li><strong>PHP 8.1 <\/strong>and earlier are end of life and will not receive this fix.<\/li>\n\n\n\n<li>No public report of in-the-wild exploitation at the time of this advisory.<\/li>\n\n\n\n<li>Action: upgrade to the fixed release on your PHP branch and restart PHP workers.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">PHP is a server-side scripting language used by a large share of production web applications. phpAfterShell (CVE-2026-126714) is a flaw in how PHP\u2019s file-based session handler writes session data to disk. When an update is interrupted, the file can keep a mix of old and new bytes, which gives an attacker a deserialization primitive on later requests. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Combined with a gadget chain in application code, this leads to remote code execution in the PHP worker. The depthfirst research team reported the issue, and PHP disclosed it on November 19, 2026. phpAfterShell lands one week after <a href=\"https:\/\/www.getastra.com\/blog\/security-advisory\/php2shell\/\" target=\"_blank\" rel=\"noreferrer noopener\">php2shell<\/a>, the last critical PHP flaw we covered.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Technical_Details_of_CVE-2026-126714_PHPafterShell\"><\/span>Technical Details of CVE-2026-126714 (PHPafterShell)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The CVE-2026-126714 (PHPafterShell) sits in PHP\u2019s file-based session storage, which PHP selects by default through <code>session.save_handler = files<\/code>. When PHP writes updated session data back to its session file it uses <code>pwrite()<\/code> followed by <code>ftruncate()<\/code>. The sequence is not atomic. If the operation is interrupted partway through, the file keeps part of the new content and part of the old content on disk.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On a later request, <code>session_start()<\/code> reads the file and runs PHP\u2019s session deserializer over the mixed bytes. An attacker who controls part of the session payload can shape the resulting stream so the deserializer produces objects of a type the attacker chooses. The result is an arbitrary object injection primitive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Session upload progress is the easiest trigger for the interrupt. The feature writes partial upload state into the session file while a POST is still in flight, which lets an attacker influence when and how a write is cut off. The primitive alone gives object injection. Chained with a suitable gadget in the loaded application code, it reaches remote code execution inside the PHP worker process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The attack vector is network-based. The vendor advisory does not publish a full CVSS vector string or a CWE identifier at the time of writing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Affected_Products_or_Versions_for_CVE-2026-126714_PHPafterShell\"><\/span>Affected Products or Versions for CVE-2026-126714 (PHPafterShell)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The flaw affects PHP\u2019s reference implementation on all actively supported branches when sessions are stored in files. The vendor lists specific minimum fixed versions for each supported branch. Applications that store sessions in Redis, a database, or another non-file handler are safe from this specific defect.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP 8.5 before 8.5.13 is affected. Fixed in 8.5.13.<\/li>\n\n\n\n<li>PHP 8.4 before 8.4.28 is affected. Fixed in 8.4.28.<\/li>\n\n\n\n<li>PHP 8.3 before 8.3.37 is affected. Fixed in 8.3.37.<\/li>\n\n\n\n<li>PHP 8.2 before 8.2.36 is affected. Fixed in 8.2.36.<\/li>\n\n\n\n<li>PHP 8.1 and earlier are end of life. The 7.4, 8.0, and 8.1 EOL mitigation branches disable upload progress in the callback and are safe from this flaw.<\/li>\n\n\n\n<li>The October 21 releases (8.5.12, 8.4.27, 8.3.36, 8.2.35) do not contain the fix.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Detection_for_CVE-2026-126714_PHPafterShell\"><\/span>Detection for CVE-2026-126714 (PHPafterShell)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start from the PHP version actually serving web traffic in production, since a repository\u2019s declared version can differ from the deployed runtime. Then confirm the session storage configuration. A host is in scope when the runtime is on an affected version and sessions are kept in files.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run <code>php -v<\/code> on each web host or container and compare the output against the fixed versions above.<\/li>\n\n\n\n<li>Check <code>php.ini<\/code> for <code>session.save_handler<\/code>. A value of <code>files<\/code>, or no value set, puts the host in scope.<\/li>\n\n\n\n<li>Check <code>php.ini<\/code> for <code>session.upload_progress.enabled<\/code>. A value of <code>1<\/code>, or no value set, enables the easiest attack path.<\/li>\n\n\n\n<li>Inspect container images and build pipelines for pinned PHP minor versions below the fixed releases.<\/li>\n\n\n\n<li>No reliable indicators of compromise have been published at this time.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Mitigation_for_CVE-2026-126714\"><\/span>Mitigation for CVE-2026-126714 <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Install the fixed release for your PHP branch: 8.5.13, 8.4.28, 8.3.37, or 8.2.36. Rebuild any container images, redeploy, and confirm production is running the new version. Restart PHP workers (php-fpm, mod_php, or the SAPI in use) so every long-lived process picks up the new binary. If you run PHP 8.1 or earlier, move to a supported branch. Those versions are end of life and will not get this fix.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Workaround_for_PHPafterShell\"><\/span>Workaround for PHPafterShell<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If an immediate upgrade is not possible, disable the session upload progress feature and limit the untrusted data your application stores in sessions. This removes the easiest path to the flaw, so treat it as an interim measure only.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set <code>session.upload_progress.enabled = 0<\/code> in <code>php.ini<\/code> and restart PHP workers.<\/li>\n\n\n\n<li>Review session contents and stop writing attacker-controlled fields into the session where possible.<\/li>\n\n\n\n<li>Where feasible, switch <code>session.save_handler<\/code> to a non-file backend such as Redis or a database for the affected hosts.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_Astra_Helps\"><\/span>How Astra Helps<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We are monitoring the situation and will update this page once more information comes in. If you need help or guidance on phpAfterShell, <a href=\"https:\/\/www.getastra.com\/contact-us\" target=\"_blank\" rel=\"noreferrer noopener\">talk to our team<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>References:<\/strong> PHP security advisory for CVE-2026-126714 (published November 19, 2026); depthfirst disclosure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TLDR; PHP is a server-side scripting language used by a large share of production web applications. phpAfterShell (CVE-2026-126714) is a flaw in how PHP\u2019s file-based session handler writes session data to disk. When an update is interrupted, the file can keep a mix of old and new bytes, which gives an attacker a deserialization primitive &#8230; <a title=\"PHPafterShell (CVE-2026-126714): Critical PHP Session RCE Fix\" class=\"read-more\" href=\"https:\/\/www.getastra.com\/blog\/security-advisory\/cve-2026-126714\/\" aria-label=\"Read more about PHPafterShell (CVE-2026-126714): Critical PHP Session RCE Fix\">Read more<\/a><\/p>\n","protected":false},"author":138,"featured_media":50373,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[819],"tags":[],"class_list":["post-50372","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security-advisory"],"_links":{"self":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/users\/138"}],"replies":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/comments?post=50372"}],"version-history":[{"count":4,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50372\/revisions"}],"predecessor-version":[{"id":50377,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50372\/revisions\/50377"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/media\/50373"}],"wp:attachment":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/media?parent=50372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/categories?post=50372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/tags?post=50372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}