First Occurrence of a PHP Fatal Error on a Web Server
Description
This rule identifies the first PHP fatal error observed on a web server during the configured history window. PHP fatal errors are not inherently malicious, but a newly observed fatal condition can indicate exploitation of a previously unseen application or PHP engine failure. The rule is intentionally generic so it can identify both known and novel exploit attempts that terminate PHP request processing.
Query · kuery
agent.id:* and event.dataset:( "apache.error" or "nginx.error" or "apache_tomcat.catalina" or "apache_tomcat.localhost" ) and ( message:(PHP and Fatal and error) )
Investigation fields
Pivot points the source recommends for triage.
@timestamphost.idhost.namehost.ipsource.ipevent.datasetlog.file.pathmessage
Known false positives
- New deployments, application defects, dependency changes, resource exhaustion, and configuration errors can legitimately produce a first-seen PHP fatal error.
- Development, staging, and quality-assurance systems may generate frequent novel fatal errors during testing.
Analyst notes
Investigating First Occurrence of a PHP Fatal Error on a Web Server
This rule establishes first-seen state by host.id, so it alerts when a host with no matching event in the history window
produces a PHP fatal error. The alert does not establish malicious activity; it prioritizes a previously unseen condition
for investigation and can provide generic coverage for exploitation paths that intentionally trigger fatal PHP states.
Possible investigation steps
- Review the complete error text and identify the affected host, virtual host, PHP script, application, and PHP version.
- Examine
source.ipwhen present. It represents the immediate requester seen by the web server and may be a proxy, load balancer, CDN node, NAT gateway, or container bridge rather than the original external client. - Correlate access logs for the same host and time with request methods, URLs, response codes, multipart bodies, session activity, and unusual cookies. Determine whether many hosts or requests produced the same error.
- Review endpoint telemetry for web-server or PHP-worker crashes, unusual child processes, file writes, and outbound connections after the fatal error.
- Compare the error with recent deployments, configuration changes, memory-limit changes, and application test activity.
False positive analysis
- Fatal errors commonly result from application bugs, missing dependencies, incompatible upgrades, and resource limits. Validate the stack trace and deployment history before treating the alert as exploitation.
- Consider excluding tightly scoped, well-understood development hosts or known error strings rather than disabling the rule across production PHP servers.
Response and remediation
- Patch or roll back the affected application or PHP runtime after preserving relevant logs and process telemetry.
- If the request or surrounding host behavior is suspicious, isolate the server, block the confirmed origin at the edge, rotate exposed secrets, and scope similar errors across the environment.