Log Security-Relevant Request Rejections and Mitigated Exploit Attempts
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- backend, observability, security
調査の方向性
Start by reviewing the attached proof of concept mentioned in the issue and the PHP runtime paths that detect and mitigate malformed or security-sensitive requests. Map how those events could reach both the configured log and the running script while avoiding sensitive request data and log flooding. Done means a general, documented event mechanism covers relevant runtime conditions and explains cases where PHP cannot safely emit a diagnostic.
索引モデルが issue の本文から書いたものです。
説明
Description
Problem
PHP can encounter malicious or malformed requests that trigger known vulnerabilities or exercise security-sensitive code paths. Fixes may prevent memory corruption, stale-state reuse, or other unintended behavior, but the administrator often receives no reliable indication that an attack was attempted. The PHP script cannot distinguish a valid request from a mitigated attack.
CVE-2026-109618 and CVE-2026-109619 demonstrate why this matters. A patched PHP runtime may prevent the vulnerable behavior. However, it provides no clear indication that the request triggered a security-relevant condition.
There are a few examples where mitigated attacks are logged. For example:
- "PHP message: PHP Warning: Missing boundary in multipart/form-data POST data in Unknown on line 0"
- "PHP message: PHP Warning: PHP Request Startup: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0"
The text in Unknown on line 0 is a great indicator of a mitigated attack. Unfortunately, the running PHP script cannot readily determine if the error message applies to the current request.
When no diagnostic is emitted, administrators are left to infer what happened from web-server access logs, worker failures, and other indirect evidence. An application script cannot reliably report conditions that occur before it starts executing.
Proposed enhancement
Provide a consistent mechanism for PHP to log security-relevant events when it detects and rejects, mitigates, or safely terminates processing of a potentially malicious request. Allow this information to be retrieved by the running application.
I've attached a working proof of concept, including source code that compiles into a PHP .so extension. It checks for errors in the current worker thread and exposes a queryable function that returns an array of potential concerns to the running PHP script. This demonstrates one way PHP could make otherwise inaccessible diagnostic information available to applications. The mechanism should be extended to cover other anomalies detected by the PHP engine.
There should be a general mechanism rather than a collection of CVE-specific messages. Potential event categories include:
- Malformed or suspicious multipart/form-data requests.
- Requests rejected because they violate parser or protocol constraints.
- Security-sensitive error and bailout paths that are safely handled by the runtime.
- Known exploit conditions that are detected and prevented by a security fix.
- Other runtime-detected conditions that could indicate an exploitation attempt.
The goal is not to label every malformed request as an attack. Log messages should describe the condition detected and the action PHP took, without asserting malicious intent when that cannot be established. The running PHP script can use this information to determine whether the request indicates a possible attack.
Logging requirements
Ideally, security-relevant events would:
- Be available to the system administrator even when the application script never starts or terminates abnormally.
- Be written to a configurable error log or dedicated security log.
- Be accessible to the running PHP script.
- Identify the event category, the mitigation or rejection action, and the relevant request or worker context.
- Avoid logging sensitive request bodies, credentials, or other unnecessary user data.
- Be configurable to control verbosity and prevent log flooding from repeated attacks.
- Use consistent, documented event identifiers so administrators can monitor and correlate events across PHP versions.
When PHP cannot safely emit a diagnostic, the documentation should explicitly identify that limitation and describe any available alternative.
Motivation
Security patches should prevent exploitation, but administrators also need visibility into attacks against their systems. Without logging, a successfully mitigated attack can be indistinguishable from an ordinary request.
This information is useful for incident response, identifying targeted systems, measuring attack activity, verifying that mitigations are being exercised, and correlating events with web-server logs.
The proposed feature would improve PHP's security observability across multiple vulnerabilities, rather than addressing only CVE-2026-109618 and CVE-2026-109619.
- 主要言語
- C
- スター
- 40.7k
- フォーク
- 8.3k
- 平均マージ
- 2日 16時間
- マージ済み PR(30日)
- 151
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
php/php-src のほかの issue
-
Bug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
zend_set_local_var() overwrites existing compiled variable (CV) zval without calling zval_ptr_dtor()オープンBug Status: Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Case-insensitive substr_compare, ksort, krsort are still locale-dependent対応中かも @lazerg が 3 日前に担当しました。 オープンBug Extension: standard Status: Verified
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
php/php-src#24552 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
master: part of the mbstring bailout fix got lost in a merge対応中かも @lazerg が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
priority:medium type:chore
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
crazy-goat/php-fpm-ng#1041 ·
メンテナーはふだん 1 日以内に返信
-
Test failure on FreeBSD: #26 unexpected system_clock source対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンlow priority rt_lib tests
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100