PHP2Shell 涉及 PHP 引擎兩項漏洞,使用 PHP 的網站應立即修補並檢查日誌
PHP2Shell Is Not a Plugin Bug. If You Run PHP Anywhere, Patch Today and Check Your Logs
PHP2Shell 包含 PHP 引擎中的兩項嚴重漏洞,可能讓未經身份驗證的攻擊者執行遠端程式碼,所有處理網頁請求的 PHP 安裝均有潛在風險。修補版本包括 PHP 8.5.12、8.4.27、8.3.36 和 8.2.35,另有 PHP 7.4、8.0 和 8.1 的最小源碼回補版本;CISA 建議不能更新的系統下線。文章亦建議修補後檢查伺服器及 PHP 錯誤日誌、異常程序和新增或修改的檔案。
文章整理了各 PHP 分支的修補版本、無法更新時的處置,以及修補後排查入侵跡象的檢查項目,方便管理者按部署情況安排應對。
Most PHP security stories are about a plugin, a theme or a sloppy upload form. This one isn't. PHP2Shell is a pair of critical bugs in the PHP engine itself, which means a perfectly written WordPress site, a Laravel app and an old custom script can all be exposed by the same flaw.
I'll keep this practical. What's vulnerable, which versions fix it, how to check what you run and what to look for if you think you were hit.
What happened
The two vulnerabilities are CVE-2026-109618, an out-of-memory corruption bug, and CVE-2026-109619, a stale global state bug. Both score 9.2 on the CVSS scale, according to SecurityWeek. Remote code execution was confirmed on Apache with mod_php.
The PHP Foundation's explanation is blunt: both issues sit in parts of PHP that nearly every request touches, memory management and error handling. That central position is what made them serious, and also what made them hard to fix. SecurityWeek says they affect nearly all PHP releases back to version 5.4, and can also be used to read sensitive process memory, which may hold credentials and API keys.
PHP's maintainers say all PHP installations that handle web requests are potentially at risk, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. Wiz estimates that, because the flaw is in PHP itself, it affects 70 percent of all websites, independent of the content management system.
The leak that moved the date
The coordinated disclosure was planned for October 22. Information leaked online on October 20, and the PHP Foundation decided to publish the patches one day early, on October 21, with a pre-announcement warning that the bugs needed immediate attention.
The scramble that followed is a case study in why embargoes are fragile. Public proof-of-concept exploits started circulating before the fixes arrived. A video demonstrating a working exploit was mistakenly published ahead of the timeline. And six hours before the coordinated release, Chainguard published built container images containing the fix. The PHP Foundation said anyone could study the fix in binary form while other users waited. Cloudflare, for its part, deployed protections nine hours before public disclosure.
Image: Kim Scarborough from Chicago, IL via Wikimedia Commons, CC BY-SA 2.0
Is it being exploited?
The reports disagree a little, and the disagreement is informative. SecurityWeek says watchTowr saw the first in-the-wild exploitation attempts hit its sensors around the time the patches landed, but not successful ones. Its head of threat intelligence said, "Whilst nobody has been successful to date, we don't expect that will last long." Hadrian reported seeing php2shell exploited in the wild at scale, mostly through PHP's session upload-progress path, and said it expected more exploit paths. Patchstack and Cloudflare also saw attempts earlier in the day.
CISA's alert, published October 21, says it hadn't observed exploitation as of publication. That's a statement about what CISA has seen, not a statement that nobody is trying. My reading: assume scanning is happening now, and that working exploits will follow quickly.
Which versions fix it
CISA tells organisations to update immediately to one of these:
| Branch | Fixed version |
|---|---|
| PHP 8.5 | 8.5.12 |
| PHP 8.4 | 8.4.27 |
| PHP 8.3 | 8.3.36 |
| PHP 8.2 | 8.2.35 |
The PHP Foundation also released minimal source backports for PHP 7.4, 8.0 and 8.1. CISA's advice for anyone who can't update, or who runs PHP 8.1 or earlier, which are unsupported, is to take PHP-based systems offline until they're patched or updated. A web application firewall may provide some protection in the meantime. The Foundation says workarounds reduce exposure to specific attack paths but don't make an installation safe.
A checklist for today
- Find PHP. CISA warns that PHP is often a component of other software, so prevalence may not be obvious. Look beyond the main web server: staging boxes, forgotten VPS instances, container images, admin tools and anything with a CMS.
- Check the version. On a server,
php -vshows the CLI version, but your web server may use a different PHP build than the command line. Check the one that actually serves requests, for example from a phpinfo page you remove straight afterwards, or from your package manager and container tags. - Patch internet-facing systems first. Update to the fixed version for your branch. If you use containers, rebuild images from a patched base and redeploy, rather than only updating the host.
- If you're on shared or managed hosting, ask your provider in writing which PHP version your site runs and when it will be patched. You can't fix this yourself on most shared plans.
- Retire what you can't patch. PHP 8.1 and earlier are unsupported, and CISA says they should be taken offline if not updated.
- Add a WAF rule if you have one, but treat it as a bridge, not a fix.
How to look for signs of compromise
Patching stops new attacks. It doesn't undo an old one. SimSpace's CTO made the point that teams need to check whether attackers reached systems before the fix was in place. CISA suggests monitoring for suspicious activity, including PHP worker processes launching shells or downloading tools.
Practically, I'd do the following after patching:
- Review web server and PHP error logs for unusual request patterns and crashes since October 20.
- Look for PHP workers spawning shells such as
shorbash, or running tools likecurlorwget. - Check for new or modified files in web roots and upload directories.
- Rotate secrets that sat in PHP process memory, such as database passwords and API keys, if you have reason to believe a server was probed. SecurityWeek notes the bugs can expose memory contents.
- Check that outbound connections from your web servers are what you expect.
Image: Shixart1985 via Wikimedia Commons, CC BY 2.0
The bigger point: AI found this
One more detail from SecurityWeek stands out. Wiz, along with OpenAI and Calif, discovered the vulnerabilities in August and kept them contained until patches existed. Wiz says the underlying flaws had been present for decades, but demonstrating exploitability required an exceptionally complex chain of steps, at the edge of what human researchers could practically do. Calif explains that an initial out-of-memory flaw was found in 2020 and rediscovered in 2024, but wasn't patched because exploitation wasn't proven. Frontier AI models helped turn it into remote code execution.
The PHP Foundation also says AI has helped surface more PHP vulnerabilities than before, with 15 new CVEs published since July 1. I think that is the real story for defenders. Old bugs that were written off as theoretical are now getting turned into working exploits, and the gap between "proven" and "patched" is shrinking.
Should you care?
Yes, if there's any chance you run PHP, and there is. This isn't a vulnerability you can ignore because your own code is clean. Patch the internet-facing machines today, then work down the list.
Frequently Asked Questions
What is PHP2Shell?
The name for two critical PHP vulnerabilities, CVE-2026-109618 and CVE-2026-109619, that can give unauthenticated attackers remote code execution.
Which PHP versions fix it?
PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Minimal source backports exist for 7.4, 8.0 and 8.1.
Do WordPress, Drupal and Joomla sites need patching?
Yes, if they run on vulnerable PHP. SecurityWeek says the bugs can be exploited against WordPress, Drupal, Joomla and other popular applications, since the flaw is in PHP itself.
What if I can't patch right now?
CISA says to take PHP-based systems offline until they can be patched. A WAF may help, but PHP's maintainers say mitigations don't make an installation safe.
Originally published on Mango Developer.
來源:DEV Community · dev.to