{
  "hunt": {
    "meta": {
      "tlp": "clear",
      "hunt": {
        "handoff": "keep-as-periodic-hunt",
        "trigger": "intel-report",
        "methodology": "model-assisted",
        "applicability": "campaign-specific",
        "justification": "PHP vulnerabilities CVE-2026-109618/19 are critical unauthenticated RCEs with observed in-the-wild exploitation. Protecting web-facing assets from unauthenticated takeover is a core security requirement."
      },
      "name": "PHP Unauthenticated RCE Exploitation",
      "type": "investigation",
      "labels": [
        "hunt",
        "attack.t1190",
        "execution",
        "initial access"
      ],
      "related": [
        {
          "hunt": "web-shell-detection-php",
          "reason": "Detection of persistent web shells written to disk by an exploit is covered in a separate hunt focused on file-system activity.",
          "relation": "sibling"
        }
      ],
      "targets": {
        "web": {
          "name": "Web server / proxy logs",
          "category": "siem",
          "telemetry": [
            "network"
          ]
        },
        "hunter": {
          "name": "Hunt agent",
          "agent": true
        },
        "analyst": {
          "name": "Tier-2 analyst",
          "role": "analyst"
        },
        "endpoint": {
          "name": "Endpoint telemetry (hb_ surfaces)",
          "category": "endpoint",
          "telemetry": [
            "endpoint"
          ]
        }
      },
      "analysis": "A simple rule for 'shell from web worker' lacks the context of the unauthenticated HTTP delivery and the precursor crashes. This hunt uses three surfaces\u2014inventory, application errors, and process activity\u2014to prove a specific, unauthenticated RCE chain against these CVEs.",
      "coverage": [
        {
          "stage": "vulnerability-scanning-and-inventory",
          "steps": [
            "inventory-vulnerable-php"
          ],
          "status": "covered"
        },
        {
          "stage": "exploit-delivery-http-request",
          "steps": [
            "suspicious-http-delivery"
          ],
          "status": "covered"
        },
        {
          "stage": "memory-corruption-and-crash",
          "steps": [
            "php-worker-crashes"
          ],
          "status": "covered"
        },
        {
          "stage": "rce-web-worker-execution",
          "steps": [
            "rare-worker-children"
          ],
          "status": "covered"
        }
      ],
      "scenario": {
        "stages": [
          {
            "name": "PHP Vulnerability Identification",
            "slug": "vulnerability-scanning-and-inventory",
            "tactic": "initial-access",
            "techniques": [
              "T1190"
            ],
            "observables": [
              "PHP 8.2 < 8.2.35",
              "PHP 8.3 < 8.3.36",
              "PHP 8.4 < 8.4.27",
              "PHP 8.5 < 8.5.12",
              "Apache mod_php",
              "PHP-FPM",
              "php-cgi",
              "FrankenPHP",
              "LiteSpeed",
              "rpms.remirepo.net"
            ]
          },
          {
            "name": "Exploit Delivery via Crafted Request",
            "slug": "exploit-delivery-http-request",
            "tactic": "initial-access",
            "techniques": [
              "T1190"
            ],
            "observables": [
              "multipart/form-data",
              "large file uploads",
              "session upload progress tracking",
              "Content-Type: multipart/form-data",
              "requests triggering OOM conditions"
            ]
          },
          {
            "name": "Worker Memory Corruption",
            "slug": "memory-corruption-and-crash",
            "tactic": "execution",
            "techniques": [
              "T1190"
            ],
            "observables": [
              "PHP worker crash",
              "Segmentation fault",
              "longjmp() OOM error",
              "fatal_error_backtraces enabled",
              "PHP-FPM worker termination"
            ]
          },
          {
            "name": "Remote Code Execution",
            "slug": "rce-web-worker-execution",
            "tactic": "execution",
            "techniques": [
              "T1190"
            ],
            "observables": [
              "Unexpected child processes of php-fpm",
              "Unexpected child processes of httpd",
              "Unexpected child processes of apache2",
              "Spawning of /bin/sh or /bin/bash from web server",
              "Web worker account privileges"
            ]
          }
        ],
        "summary": "Critical unauthenticated remote code execution vulnerabilities in PHP (CVE-2026-109618 and CVE-2026-109619) allow attackers to gain web worker privileges via memory corruption during out-of-memory handling or use-after-free flaws in global state. Exploitation typically involves crafted multipart HTTP requests or leveraging session upload tracking to access stale memory across requests."
      },
      "severity": "high",
      "rationale": "Begin with internet-exposed servers running PHP-FPM or Apache. Focus on hosts where HTTP POST traffic to .php endpoints is common.",
      "guardrails": {
        "claims": "no_unsupported",
        "evidence": "citation_required",
        "telemetry": "untrusted",
        "missing_data": "not_benign"
      },
      "hypothesis": "An adversary is exploiting unauthenticated RCE in PHP (CVE-2026-109618/19) by delivering crafted multipart requests that trigger memory corruption or stale-state access, confirmed by worker crashes and rare child processes.",
      "parameters": {
        "scope_hosts": {
          "from": {
            "ref": "hunt-standard",
            "kind": "manual",
            "observed": "2026-10-21"
          },
          "type": "list[host]",
          "default": [],
          "description": "Specific hosts to scope (leave empty for all)."
        },
        "lookback_days": {
          "from": {
            "ref": "hunt-standard",
            "kind": "manual",
            "observed": "2026-10-21"
          },
          "type": "number",
          "default": "14",
          "description": "Days of history to examine."
        },
        "web_worker_names": {
          "from": {
            "ref": "Rapid7",
            "kind": "article",
            "observed": "2026-10-21"
          },
          "type": "list[string]",
          "default": [
            "php-fpm",
            "apache2",
            "httpd",
            "php-cgi",
            "frankenphp",
            "litespeed"
          ],
          "description": "PHP worker and web server process names."
        },
        "vulnerable_version_prefixes": {
          "from": {
            "ref": "Rapid7",
            "kind": "article",
            "observed": "2026-10-21"
          },
          "type": "list[string]",
          "default": [
            "8.2.",
            "8.3.",
            "8.4.",
            "8.5."
          ],
          "description": "PHP versions prefixes affected; check against local inventory."
        }
      },
      "provenance": {
        "authors": [
          {
            "org": "huntbase.io",
            "name": "Huntbase hunt generation"
          }
        ],
        "generated": {
          "by": "huntbase-hunt-generation",
          "from": "https://www.rapid7.com/blog/post/etr-cve-2026-109618-and-cve-2026-109619-critical-unauthenticated-remote-code-execution-in-php",
          "gates": [
            "dry-run",
            "lint",
            "critic"
          ],
          "model": "hb_google/gemini-3-flash-preview"
        }
      },
      "references": [
        {
          "url": "https://www.rapid7.com/blog/post/etr-cve-2026-109618-and-cve-2026-109619-critical-unauthenticated-remote-code-execution-in-php",
          "name": "Rapid7 \u2014 CVE-2026-109618 and CVE-2026-109619: Critical RCE in PHP"
        }
      ],
      "blind_spots": [
        {
          "id": "no-endpoint-telemetry",
          "risk": "A compromised Linux web server without an endpoint agent will only show delivery and potential network activity, but successful code execution will be invisible.",
          "stage": "rce-web-worker-execution",
          "question": "whether rare child processes are running on non-enrolled Linux servers",
          "requires": "hb_process_activity on Linux servers"
        },
        {
          "id": "http-body-visibility",
          "risk": "The hunt relies on the size of the request and session query parameters; a highly optimized exploit under 1MB might not trigger the delivery threshold.",
          "stage": "exploit-delivery-http-request",
          "question": "whether the multipart data specifically contains exploit shellcode",
          "requires": "request body inspection"
        }
      ]
    },
    "name": "PHP Unauthenticated RCE Exploitation",
    "description": "This hunt identifies the full exploitation chain for critical PHP vulnerabilities announced in October 2026. It begins by scoping vulnerable PHP installations, then correlates suspicious HTTP delivery attempts with concurrent application-layer crashes (segmentation faults). In the follow-on phase, it pivots to identify successful remote code execution by stack-counting child processes of PHP workers across the fleet to find rare or anomalous execution. An analyst then uses the combined context to isolate compromised hosts and apply emergency mitigations."
  },
  "nodes": [
    {
      "id": "hypothesis",
      "type": "hypothesis",
      "label": "Hypothesis",
      "config": {
        "tags": [],
        "coverage": [
          {
            "stage": "vulnerability-scanning-and-inventory",
            "steps": [
              "inventory-vulnerable-php"
            ],
            "status": "covered"
          },
          {
            "stage": "exploit-delivery-http-request",
            "steps": [
              "suspicious-http-delivery"
            ],
            "status": "covered"
          },
          {
            "stage": "memory-corruption-and-crash",
            "steps": [
              "php-worker-crashes"
            ],
            "status": "covered"
          },
          {
            "stage": "rce-web-worker-execution",
            "steps": [
              "rare-worker-children"
            ],
            "status": "covered"
          }
        ],
        "rationale": "An adversary is exploiting unauthenticated RCE in PHP (CVE-2026-109618/19) by delivering crafted multipart requests that trigger memory corruption or stale-state access, confirmed by worker crashes and rare child processes.",
        "blind_spots": [
          {
            "id": "no-endpoint-telemetry",
            "risk": "A compromised Linux web server without an endpoint agent will only show delivery and potential network activity, but successful code execution will be invisible.",
            "stage": "rce-web-worker-execution",
            "question": "whether rare child processes are running on non-enrolled Linux servers",
            "requires": "hb_process_activity on Linux servers"
          },
          {
            "id": "http-body-visibility",
            "risk": "The hunt relies on the size of the request and session query parameters; a highly optimized exploit under 1MB might not trigger the delivery threshold.",
            "stage": "exploit-delivery-http-request",
            "question": "whether the multipart data specifically contains exploit shellcode",
            "requires": "request body inspection"
          }
        ],
        "scoping_notes": "Begin with internet-exposed servers running PHP-FPM or Apache. Focus on hosts where HTTP POST traffic to .php endpoints is common.",
        "beyond_detection": "A simple rule for 'shell from web worker' lacks the context of the unauthenticated HTTP delivery and the precursor crashes. This hunt uses three surfaces\u2014inventory, application errors, and process activity\u2014to prove a specific, unauthenticated RCE chain against these CVEs."
      }
    },
    {
      "id": "inventory-vulnerable-php",
      "type": "query",
      "label": "Inventory vulnerable PHP installations",
      "config": {
        "dsl": "sqlite",
        "role": "scoping",
        "source": "endpoint",
        "content": "SELECT device_hostname, package_name, package_version, install_path FROM hb_software_inventory WHERE LOWER(package_name) LIKE '%php%' AND (instr(',' || '{{vulnerable_version_prefixes}}' || ',', ',' || SUBSTR(package_version, 1, 4) || ',') > 0) AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "surface": "hb_software_inventory",
        "description": "Identify hosts running PHP versions prior to the October 2026 security updates.",
        "expected_signal": "A list of hosts with affected PHP versions. Silence means no PHP was found in the inventory."
      },
      "parents": [
        {
          "id": "hypothesis"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "scoping",
        "label": "Inventory vulnerable PHP installations",
        "reads": [
          "device_hostname",
          "package_name",
          "package_version",
          "install_path"
        ],
        "source": "hb_software_inventory",
        "target": "endpoint",
        "content": "SELECT device_hostname, package_name, package_version, install_path FROM hb_software_inventory WHERE LOWER(package_name) LIKE '%php%' AND (instr(',' || '{{vulnerable_version_prefixes}}' || ',', ',' || SUBSTR(package_version, 1, 4) || ',') > 0) AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "silence": "not_evidence_of_absence",
        "expected": "A list of hosts with affected PHP versions. Silence means no PHP was found in the inventory.",
        "verified": "dry-run",
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "suspicious-http-delivery",
      "type": "query",
      "label": "Suspicious multipart HTTP delivery",
      "config": {
        "dsl": "sqlite",
        "role": "enrichment",
        "source": "web",
        "content": "SELECT device_hostname, url_path, http_method, request_body_len, url_query, time FROM hb_http_activity WHERE LOWER(url_path) LIKE '%.php%' AND http_method = 'POST' AND (request_body_len > 1048576 OR LOWER(url_query) LIKE '%progress%') AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "surface": "hb_http_activity",
        "description": "Identify large multipart POST requests or queries targeting session upload progress, which are common exploit triggers.",
        "expected_signal": "POST requests over 1MB or containing session tracking queries. Silence proves no such requests reached the logs."
      },
      "parents": [
        {
          "id": "inventory-vulnerable-php"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "enrichment",
        "label": "Suspicious multipart HTTP delivery",
        "reads": [
          "device_hostname",
          "url_path",
          "http_method",
          "request_body_len",
          "url_query",
          "time"
        ],
        "source": "hb_http_activity",
        "target": "web",
        "content": "SELECT device_hostname, url_path, http_method, request_body_len, url_query, time FROM hb_http_activity WHERE LOWER(url_path) LIKE '%.php%' AND http_method = 'POST' AND (request_body_len > 1048576 OR LOWER(url_query) LIKE '%progress%') AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "silence": "evidence_of_absence",
        "expected": "POST requests over 1MB or containing session tracking queries. Silence proves no such requests reached the logs.",
        "verified": "dry-run",
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "php-worker-crashes",
      "type": "query",
      "label": "PHP worker application faults",
      "config": {
        "dsl": "sqlite",
        "role": "triage",
        "source": "endpoint",
        "content": "SELECT device_hostname, app_name, exception_code, message, time FROM hb_application_error WHERE (instr(',' || '{{web_worker_names}}' || ',', ',' || LOWER(app_name) || ',') > 0 OR LOWER(message) LIKE '%php%') AND (exception_code = 'c0000005' OR LOWER(message) LIKE '%segmentation fault%' OR LOWER(message) LIKE '%out of memory%') AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "surface": "hb_application_error",
        "description": "Find segmentation faults or OOM errors in PHP workers indicating successful memory corruption.",
        "expected_signal": "Faults in web worker processes. Silence means no worker crashes were recorded."
      },
      "parents": [
        {
          "id": "inventory-vulnerable-php"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "triage",
        "label": "PHP worker application faults",
        "reads": [
          "device_hostname",
          "app_name",
          "exception_code",
          "message",
          "time"
        ],
        "source": "hb_application_error",
        "target": "endpoint",
        "content": "SELECT device_hostname, app_name, exception_code, message, time FROM hb_application_error WHERE (instr(',' || '{{web_worker_names}}' || ',', ',' || LOWER(app_name) || ',') > 0 OR LOWER(message) LIKE '%php%') AND (exception_code = 'c0000005' OR LOWER(message) LIKE '%segmentation fault%' OR LOWER(message) LIKE '%out of memory%') AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "silence": "not_evidence_of_absence",
        "expected": "Faults in web worker processes. Silence means no worker crashes were recorded.",
        "verified": "dry-run",
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "precursor-triage",
      "type": "analytic",
      "label": "Early stage exploit triage",
      "config": {
        "cite": "required",
        "tools": [
          "endpoint",
          "web"
        ],
        "context": [
          "inventory-vulnerable-php",
          "suspicious-http-delivery",
          "php-worker-crashes"
        ],
        "objective": "Determine which hosts show coincident exploit delivery patterns and application crashes, signifying exploit attempts.",
        "description": "Identify hosts showing a temporal correlation between suspicious HTTP delivery and worker crashes.",
        "max_iterations": 3,
        "expected_signal": "A list of hosts where PHP exploitation precursors are present.",
        "success_criteria": "A risk-ranked list of hosts with delivery-to-crash correlation."
      },
      "parents": [
        {
          "id": "suspicious-http-delivery",
          "kind": "merge"
        },
        {
          "id": "php-worker-crashes",
          "kind": "merge"
        }
      ]
    },
    {
      "id": "rare-worker-children",
      "type": "query",
      "label": "Rare child processes of web workers",
      "config": {
        "dsl": "sqlite",
        "role": "detection-candidate",
        "source": "endpoint",
        "content": "SELECT LOWER(process_name) AS child_proc, parent_process_name, COUNT(DISTINCT device_hostname) AS hosts, COUNT(*) AS occurrences, MIN(time) AS first_seen FROM hb_process_activity WHERE (instr(',' || '{{web_worker_names}}' || ',', ',' || LOWER(parent_process_name) || ',') > 0 OR parent_process_name LIKE '%php%' OR parent_process_name LIKE '%httpd%') AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) GROUP BY LOWER(process_name), parent_process_name HAVING hosts <= 3 ORDER BY hosts, occurrences",
        "surface": "hb_process_activity",
        "description": "Identify successful RCE by finding rare or unexpected child processes spawned by web workers across the fleet.",
        "expected_signal": "Rare binaries or shells spawned by web workers. Silence means no anomalous children were observed."
      },
      "parents": [
        {
          "id": "precursor-triage"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "detection-candidate",
        "label": "Rare child processes of web workers",
        "reads": [
          "device_hostname",
          "parent_process_name",
          "process_name",
          "time"
        ],
        "source": "hb_process_activity",
        "target": "endpoint",
        "content": "SELECT LOWER(process_name) AS child_proc, parent_process_name, COUNT(DISTINCT device_hostname) AS hosts, COUNT(*) AS occurrences, MIN(time) AS first_seen FROM hb_process_activity WHERE (instr(',' || '{{web_worker_names}}' || ',', ',' || LOWER(parent_process_name) || ',') > 0 OR parent_process_name LIKE '%php%' OR parent_process_name LIKE '%httpd%') AND time >= datetime('now', '-{{lookback_days}} days') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) GROUP BY LOWER(process_name), parent_process_name HAVING hosts <= 3 ORDER BY hosts, occurrences",
        "silence": "evidence_of_absence",
        "baseline": {
          "window": "{{lookback_days}}d",
          "compare": "first_seen"
        },
        "expected": "Rare binaries or shells spawned by web workers. Silence means no anomalous children were observed.",
        "verified": "dry-run",
        "prevalence": {
          "by": "device_hostname",
          "key": [
            "process_name"
          ],
          "rare_below": 3
        },
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "impact-verdict",
      "type": "analytic",
      "label": "Final exploitation verdict",
      "config": {
        "cite": "required",
        "tools": [
          "endpoint",
          "web"
        ],
        "context": [
          "precursor-triage",
          "rare-worker-children"
        ],
        "objective": "Identify successful RCE on at-risk hosts by correlating previously triaged crashes and delivery with rare process execution.",
        "description": "Combine the precursor triage with the rare process evidence to confirm successful unauthenticated RCE.",
        "max_iterations": 3,
        "expected_signal": "A confirmed verdict of malicious exploitation per host.",
        "success_criteria": "A verdict of malicious for hosts showing the full exploitation chain."
      },
      "parents": [
        {
          "id": "rare-worker-children"
        }
      ]
    },
    {
      "id": "route-impact",
      "type": "checkpoint",
      "label": "Route on verdict",
      "config": {
        "fuzzy": true,
        "judge": "hunter",
        "question": "the impact-verdict is malicious for at least one host",
        "condition": "the impact-verdict is malicious for at least one host",
        "blind_spot": "no-endpoint-telemetry",
        "confidence": "high",
        "description": "Direct the response based on the final impact verdict.",
        "checkpoint_type": "mandatory"
      },
      "parents": [
        {
          "id": "impact-verdict"
        }
      ]
    },
    {
      "id": "isolate-host",
      "type": "action",
      "label": "Isolate host and apply mitigations",
      "config": {
        "target": "endpoint",
        "description": "Terminate adversary access and apply immediate configuration hardening.",
        "instructions": "Isolate the host immediately. Apply emergency mitigations in php.ini: set memory_limit=-1 and session.upload_progress.enabled=0, then restart the worker service. Update PHP to fixed versions (8.2.35+, 8.3.36+, 8.4.27+, or 8.5.12+).",
        "action_approval": "required"
      },
      "parents": [
        {
          "id": "route-impact",
          "branch": "on_supports"
        }
      ]
    },
    {
      "id": "forensic-review",
      "type": "task",
      "label": "Forensic investigation",
      "config": {
        "assignee": "analyst",
        "description": "Manually review the anomalous child processes and identify the source of the exploit attempts.",
        "instructions": "Investigate the anomalous child processes identified in the follow-on phase. Correlate the timing with the source IPs from the HTTP delivery query to trace the actor."
      },
      "parents": [
        {
          "id": "route-impact",
          "branch": "default"
        },
        {
          "id": "route-impact",
          "branch": "on_unavailable"
        },
        {
          "id": "isolate-host"
        }
      ]
    },
    {
      "id": "patching-audit",
      "type": "task",
      "label": "Remediation and patching audit",
      "config": {
        "assignee": "analyst",
        "description": "Verify all vulnerable instances are patched and monitor for remaining exposure.",
        "instructions": "Perform a final audit using the inventory query to ensure all vulnerable PHP versions have been updated. Ensure configuration hardening (memory_limit and upload_progress) is enforced by default."
      },
      "parents": [
        {
          "id": "route-impact",
          "branch": "on_refutes"
        },
        {
          "id": "forensic-review"
        }
      ]
    }
  ]
}