CONNECT WITH US
Cyber Security

Cyber Security

phpAfterShell Explained: How Hackers Could Turn a PHP Session Flaw Into Code Execution

The Hacker News logo

Published on

Add as a preferred source on Google
phpAfterShell Explained: How Hackers Could Turn a PHP Session Flaw Into Code Execution

PHP's default file-based session storage can be made to return objects an attacker chose, by cutting off a session write at the right moment. When combined with a second weakness, such as a suitable gadget chain in the app, those objects can allow the attacker to run code on the server.

The flaw is tracked as CVE-2026-126714 and rated 9.2 out of 10 on the CVSS 4.0 scale by PHP's maintainers. Depthfirst, a security company, says it found the flaw and reported it to the maintainers.

The October 21 PHP releases, which fixed two critical flaws known as PHP2Shell, do not contain this fix. Servers updated then remain affected until they install today's releases. Neither the maintainers nor the company reports any attacks using phpAfterShell.

The flaw is in the files session handler, which PHP uses by default. Sessions kept in Redis, a database, or another store are outside this defect, though each store's handling of a cut-off update needs its own check.

Whether an attacker needs to log in depends on how the app exposes its session handling.

On the path the company tested, the attacker uses upload progress, a PHP feature that records the progress of a file upload in the user's session. Where the feature is on, a multipart form upload that carries its field makes PHP write to the session before the app's own code runs. The app does not need an upload page, only any page that opens the session later.


Source link

Disclaimer

We strive to uphold the highest ethical standards in all of our reporting and coverage. We TheMorningPulse.fyi want to be transparent with our readers about any potential conflicts of interest that may arise in our work. It's possible that some of the investors we feature may have connections to other businesses, including competitors or companies we write about. However, we want to assure our readers that this will not have any impact on the integrity or impartiality of our reporting. We are committed to delivering accurate, unbiased news and information to our audience, and we will continue to uphold our ethics and principles in all of our work. Thank you for your trust and support.