PHP 爆發出史上最嚴重的 RCE 漏洞「php2shell」(CVE-2026-109618 與 CVE-2026-109619),評分高達 9.2分
- PHP 官方公告:Security advisory: Critical remote code execution vulnerabilities, update now
- CVE 漏洞細節:RCE via OOM corruption · Advisory · php/php-src · GitHub
- Wiz 漏洞分析:PHP2Shell: AI uncovers critical RCE vulnerabilities affecting 70% of the Internet
嚴重到日本首相高市早苗都直接宣佈:
- 「各位,今晚有件極為緊急的請求,希望各位能配合處理」,呼籲所有公開營運的網站管理者確認是否使用PHP,並在修補程式公開前做好準備盡速套用;如果難以在第一時間修補,暫停網站運作也是降低風險的有效做法之一
先說解法:
- PHP 8.2 以上:用官方 Patch 或 Debian 官方套件 apt upgrade 即可
- PHP 7.x 以下(暫解):可以考慮此篇文章 php_uploadprogress_guard 的套件(.so)
目前 PHP 官方有出的 Patch:8.5.12、8.4.27、8.3.36、8.2.35 (正解是需要升級到這些版本)
針對 7.x 以下的版本,官方目前還沒有提供 Patch,所以需要另外處理,有提供 ini 檔的修改解法:(不過下面兩位專家說沒用)
- session.upload_progress.enabled = Off
- post_max_size = 8M or 32M (限制大小)
- memory_limit = -1
- max_input_nesting_level = 8 (設小一點)
- expose_php = 0
- PHP 8.5:fatal_error_backtraces = 0 (關閉)
- PHP-FPM:pm.max_requests 設小一點
PHP Foundation 的核心開發與管理機構成員:
- Gina Peter Banyard(PHP 核心開發者與文件維護者):「唯一的緩解措施就是直接進行修補或升級 PHP」,不存在任何十全十美的臨時替代方案
- Gina Peter Banyard, a PHP core developer and documentation writer funded by the PHP Foundation, wrote: "The only thing I can say is that the only mitigation is patching / upgrading PHP." I sadly know too much.
- Joe Ferguson(PHP 8.6 版本 Release 管理員):「ini 設定救不了你(ini settings won't save you)。」 警告所有站長切勿依賴修改 php.ini 配置來當作避風港
- Joe Ferguson, the release manager for the coming PHP 8.6, put it shorter: "ini settings won't save you."
