中文

PHP2Shell Hole server Safety Guide

2026-10-24 Huanan Tengfei Technology
PHP2Shell Hole server Safety Guide

PHP Two RCE leaks were detected in 14 by AI in the year, and the global 70% website was affected and the patches were looted before they were released. This paper addresses the rationale for the gaps, the scope of impact, the methodology for mapping and the Protection programme, with a list of emergency cases on the government website.

Last week a friend of operations and maintenance who was a government website was woken up in the middle of the night by phone - the PHP version of the network of office officials was too old, was redacted with a secure scanning and the leader asked for a fixation within 48 hours. He went through a security announcement and found a loophole called PHP2Shell fermenting, a patch that had been released for two days and had been attacked over a million times. Even more worrying is that their PHP version is not in the official restoration range.

This is not an example. 10 Month 21 Day PHP Emergency security updates issued. , It's fixed. two A sneak. 14 Year's remote code implementation gap , Numbering CVE-2026-109618 and CVE-2026-109619。 The affected version covers PHP 5.4.0 to 8.5.11, which is almost all PHP versions since 2012. According to W3Techs Statistics ,PHP It holds the world together. seven It's a website. 。 These two loopholes do not require any identity certification, and an abnormal HTTP request allows the assailant to enforce any code on server or to read the passwords and keys directly from memory.

What's wrong with the hole?

First, it is clear that the two loopholes are technically different, as the way of protection is different.

CVE-2026-109618 (CVSS 9.2): memory depleted the trigger RCE. PHP When handling multipart forms for uploading, a form without Content-Length can bypass post_max_size for inspection, and empty file controls are not counted in max_file_uploads but are still assigned memory. The attackers used it. one Make room. PHP Exhausted at certain moments. memory , Trigger longjmp() Forced Out Context , Stay. one Half-initialized. memory Consider it a legitimate data processing. 。 Under Apache mod_php, this happened before your business code was running, and the application layer Protection could not stop. Even worse, there is a Heartbleed path, which writes the process memory into PHPSESSID responding to Cookie and which can be disclosed one time about 67KB server memory - the passwords, tokens, API keys left behind by other requests, were taken away.

CVE-2026-109619 (CVSS 9.2: UAF left over request status. The PHP-FPM work process handles multiple requests in sequence, and after the previous request closed with a fatal error, part of the global state pointer remains after memory is released. When the next request was taken over by the same process, the initialization reset had not yet taken place and the expired pointer had been consumed - the classic Use-After-Free. The confirmed attack path has two paths: the default session.upload_progress upload progress track and the fatal error tracer Functions of PHP 8.5. The longer the process is repeated, the more stable it is to be used.

14 hasn't found out in years. AI's been in contact for three days.

The thing that scares me most is not the hole itself, but the 14 that hides.

In 2024, the Open Source Security Foundation OSTIF commissioned a third-party audit of php-src by French Security company Quarkslab, which has touched the very beginning of the memory anomaly. However, researchers have been unable to establish a stable cross-requesting chain, to prove remote availability and to file defects on a low-risk basis.

This year's 6 month. OpenAI Launched the " Patch the Planet " program, and Calif Security Researcher selected PHP as the audit target. With GPT-5.6, he made the first complete remote code execution path on 8 January 1. It took only three days from the beginning of the audit to the opening of the utilization chain. The Wiz research team then independently validated the attack in Drupal and WordPress using self-study tools plus Gemini 4 Argon. The reset of Wiz is: "Prove that such defects are available and that multiple problems need to be linked into a complex chain, almost to the limit of the ability of human researchers. " A researcher, supported by a model, completed several months of work in the past with a top team in one week.

The patch is not a code fix in itself, but rather a low-level re-construction of the PHP memory anomaly processing logic - longjmp() when removing OOM - to exit by force when the elegant drop-off, over-threshold value is performed at the virtual machine security point and to reset the full requested level of the requested global state at the requested boundary. AI proved a loophole for three days, and it took two months for human engineers to block it.

The attack is faster than the patch.

It was a coordinated disclosure process. , Patch set in 10 Month 22 Issued on a day 。 However, on 10 month 17, the first attempt at utilization was recorded by the Amazon threat intelligence team ' s honey can, at a time when the loophole was still in a tight confidential period. 10 Month 20 Day ,Hacker News There's an anonymous post coming out. CVE Illustration and attack tools. , The post was deleted. , The message has been spread. 。 The Calif team also mispublished an uncleaned POC demonstration Video, the content of which has been retained.

10 Month 21 Number of days before patches are released hours , Multiple-source attack attempts have begun to reach the safety plant sensors. 。 After patches are released 45 minutes , The number of attacks rises to a point. ten thousand Times ; two hours Post-Access one hundred thousand Times ; Cumulative number the following day one million Times 。 Cloudflare Before Patch Release 9 hours It's just a silent release to the full number of clients. WAF Protection Rule , But the attacker started using a real-time variable load from the interceptor's feedback. , Test to bypass the path 。

More alarmingly, TellYouThePass blackmail software has begun to use similar PHP holes to attack unrefurled server. Once the attackers have access to the Web service process, they move horizontally to find high-value data, encryption extortion.

How do you screen and protect the government website?

Tell me about the actual operation. If you're running the corporate website, the following is an enforceable emergency list.

Step one. : Feel it. PHP Bottom of Version 。 php -v `Acknowledgment version implemented on server. Focus on:

PHP VersionWhether affectedOfficial PatchOperational Recommendations
8.5.0-8.5.11Yes8.5.12Upgrade Now
8.4.0-8.4.26Yes8.4.27Upgrade Now
8.3.0-8.3.35Yes8.3.36Upgrade Now
8.2.0-8.2.34Yes8.2.35Upgrade Now
8.1 and earlierYesNo official patchesMust Migration to Supported Version
5.4-8.0YesNo official patchesTop Priority Migration

PHP 8.1 and earlier versions have terminated official Supported, can only self-compile source backup, and cannot be updated by a package manager. A large number of individual sites, networks of SME officials, legacy systems that have not been repeated for many years, will hardly be able to invest human resources in their upgrading. If you run server, you run PHP 5.x or 7.x, that's the risk maximum exposure.

Step two. : First up for patches WAF Rule 。 Don't wait until the patch is finished. Adding intercept rules to the multipart anomaly form on WAF or CDN floors, filtering form submissions, empty file control batch submissions, abnormal PHPSESSID response headers without Content-Length. If Cloudflare or similar CDN, confirm whether automatic has downplayed rules; if self-built WAF, manual should be added.

Step three. : Limits PHP-FPM Process Reuse 。 CVE-2026-109619 Use-dependent process reuse , The temporary plan is... php.ini Medium Settings `pm.max_requests=1`, Force each work process to process only one Destruction and reconstruction after request 。 The cost is a decline in performance, but the patch can be restored after validation.

Step four. : Closure is not necessary Functions 。 Set `session.upload_progress.enabled=0 ' in php.ini if the operation does not require the uploading of a file to track progress. This path has been identified and is available, with a direct elimination of a surface.

Step five. : Authentication Patch , Don't be blind. 。 Validation of PHP 8.5.12/8.4.27/8.3.36/8.2.35 compatibility with existing applications in the test environment. The focus sheets are uploaded, session and large files are processed. After confirmation of no return, production is carried by the full-scale rhythm of the greyscale in groups.

After the patch, the defense can't be just upgraded.

The incident revealed a structural problem: traditional security Protection height relied on the "fixing patch" finish line. However, AI is changing the pace of the discovery of the loophole - it is found that the cost is decreasing and that the cost of repair is not. PHP2Shell Yes AI Three days. 、 Two months of human recovery. 。 The next loophole may be found faster and the repair window will be pressed shorter.

For the government website, deep defense is the answer:

  • Edge protection prefix: WAF rules should be in place before patches are released, not until the loophole is made public.
  • Process isolation: PHP-FPM process regularly destroys reconstruction and limits the number of single process re-uses
  • memory Monitor: Unusual memory read/write surveillance of Web service process.
  • Document completeness verification: Baseline snapshot of website root catalogues, prompt warning of unauthorised document changes
  • minimum permissions to run: Web service processes run with minimum permissions, even if limited by RCE

When we made operations and maintenance safe for a few domestic business clients in Shenzhen, this in-depth defense was landed. Not every loophole can be filled in time, but every floor Protection can buy time for the next floor. PHP2Shell proved that the attack would be a robbery, and Protection had to learn to run.

---

Frequently asked questions

PHP2Shell What are the loopholes affecting? PHP Version ?

All affected from PHP 5.4.0 released in 2012 to 8.5.11. The official fixes are 8.5.12, 8.4.27, 8.3.36, and 8.2.35. PHP 8.1 and earlier versions have terminated official Supported and cannot be updated by the package manager and must be migrated to version Supported.

Are the patches safe when they're done?

Not necessarily. The pre-compensation attack had already begun and, if server had been invaded before the patch, the attackers might have been implanted into the back door. The patches also require document integrity verification, checking whether the Web root directory contains unauthorized files, the sorting of abnormal processes and planned tasks.

Do you need to focus on a website that does not use PHP?

If your server runs other PHP applications (e. g. WordPress, Drupal, phpMyAdmin), even if the main station is not PHP, it will be affected. The check should not only look at the main station technology vault, but also check all PHP processes on server.

WAF, can you stop this loophole?

Cloudflare Before patches are released 9 hours It's going down to the full client. WAF Rule 。 Self-constructing WAF requires the addition of intercept rules for an anomaly form for multipart to filter the form submission and the submission of empty file control batches without Content-Length. But WAF is not the end, the patch still has to be played.

MLPS Level Three Are you gonna check this out? ?

Yes. MLPS 2.0 Level Three Request " Timely repair of security gaps in application systems ",PHP High-risk loopholes are a requirement. 。 If the PHP version was found to have high-risk gaps known and not repaired at the time of the evaluation, it would be found to be in non-compliance.

---

:: Huanan Tengfei Technology provides security for the government website operations and maintenance, the gap response and the WAF Protection programme deployment of service, 7×24 hours security guard, 60 minutes response. Contact 13510444731 if PHP is required for gap-checking or security assessment. *

Related Content