CVE-2026-109619: PHP 8.2 < 8.2.35, 8.3 < 8.3.36, 8.4 < 8.4.27, 8.5 < 8.5.12 - Use-After-Free Remote Code Execution

2026-11-09 PoC Public

Description

PHP 8.2 before 8.2.35, 8.3 before 8.3.36, 8.4 before 8.4.27, and 8.5 before 8.5.12 contain a use-after-free caused by request-owned global state that is not reset before the request heap is freed, letting unauthenticated attackers execute arbitrary code in a subsequent request handled by the same worker; exploitation requires a crafted request sequence and a reachable session or INI consumer.

This template performs a passive version check against the PHP version disclosed in the X-Powered-By or Server response header and does not send a crafted request. It follows same-origin redirects (same host and port); redirects to another origin are ignored so a third-party response cannot be attributed to the scanned host. Limitations: detection requires the version to be exposed, so hosts with expose_php=Off and no PHP version in the Server header, hosts behind a proxy or FastCGI configuration that strips these headers, and applications that override them are not detected. These headers can also be spoofed, so a match is only as trustworthy as the disclosed header. Builds that backport the fix while keeping the upstream version number (for example 8.2.34-1ubuntu1) still match, so a match reports an affected upstream version rather than confirmed exploitability. Pre-release or development builds of a fixed version (for example 8.2.35RC1) and responses that advertise conflicting versions in different headers are not matched.

Details

CVE
CVE-2026-109619 · CVE.org
Severity
高危
Published
PoC
Public

PoC

id: CVE-2026-109619

info:
  name: PHP 8.2 < 8.2.35, 8.3 < 8.3.36, 8.4 < 8.4.27, 8.5 < 8.5.12 - Use-After-Free Remote Code Execution
  author: comradezephyr (Abdullah Shahid)
  severity: critical
  description: |
    PHP 8.2 before 8.2.35, 8.3 before 8.3.36, 8.4 before 8.4.27, and 8.5 before 8.5.12 contain a use-after-free caused by request-owned global state that is not reset before the request heap is freed, letting unauthenticated attackers execute arbitrary code in a subsequent request handled by the same worker; exploitation requires a crafted request sequence and a reachable session or INI consumer.
    This template performs a passive version check against the PHP version disclosed in the X-Powered-By or Server response header and does not send a crafted request. It follows same-origin redirects (same host and port); redirects to another origin are ignored so a third-party response cannot be attributed to the scanned host. Limitations: detection requires the version to be exposed, so hosts with expose_php=Off and no PHP version in the Server header, hosts behind a proxy or FastCGI configuration that strips these headers, and applications that override them are not detected. These headers can also be spoofed, so a match is only as trustworthy as the disclosed header. Builds that backport the fix while keeping the upstream version number (for example 8.2.34-1ubuntu1) still match, so a match reports an affected upstream version rather than confirmed exploitability. Pre-release or development builds of a fixed version (for example 8.2.35RC1) and responses that advertise conflicting versions in different headers are not matched.
  impact: |
    Unauthenticated attackers can execute arbitrary code with the privileges of the PHP worker, leading to full compromise of the web server.
  remediation: |
    Upgrade to PHP 8.2.35, 8.3.36, 8.4.27, or 8.5.12 and restart all PHP workers. Until patched, set session.upload_progress.enabled=0 and memory_limit=-1 as partial mitigations.
  reference:
    - https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp
    - https://www.php.net/archive/2026.php#2026-10-21-5
    - https://www.openwall.com/lists/oss-security/2026/10/21/7
    - https://calif.io/php2shell/
    - https://www.wiz.io/blog/php2shell-php-rce
    - https://nvd.nist.gov/vuln/detail/CVE-2026-109619
  classification:
    cvss-metrics: CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
    cvss-score: 9.2
    cve-id: CVE-2026-109619
    epss-score: 0.99999
    epss-percentile: 0.99999
    cwe-id: CWE-416
    cpe: cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: php
    product: php
    shodan-query: 'http.headers:"X-Powered-By: PHP"'
    fofa-query: 'header="X-Powered-By: PHP"'
  tags: cve,cve2026,php,php2shell,rce,use-after-free,passive,kev,vkev

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    host-redirects: true
    max-redirects: 2

    matchers:
      - type: dsl
        dsl:
          - "(compare_versions(version, '>= 8.2.0') && compare_versions(version, '< 8.2.35')) || (compare_versions(version, '>= 8.3.0') && compare_versions(version, '< 8.3.36')) || (compare_versions(version, '>= 8.4.0') && compare_versions(version, '< 8.4.27')) || (compare_versions(version, '>= 8.5.0') && compare_versions(version, '< 8.5.12'))"

    extractors:
      - type: regex
        name: version
        part: header
        group: 1
        regex:
          - '(?im)^(?:x-powered-by:\s*PHP/|server:[^\r\n]*?\bPHP[/ ])([0-9]+\.[0-9]+\.[0-9]+)'
# digest: 4a0a00473045022100b2de261b33e96282ecd7fac3a90c46979bf4b57e03c9adbfa7e1f54ae3435f1d022010ec558b2336db0d94277d5b7c51fad06387ebadc7caa4a717ac42754e10c66b:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

微信搜一搜 biu.life