Guest User

php_session_upload_progress_uaf.yar

a guest
Oct 21st, 2026
435
0
358 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YARA 5.33 KB | Cybersecurity | 0 0
  1. /*
  2.     php_session_upload_progress_uaf.yar
  3.  
  4.     Heuristic detection for exploitation of the PHP session.upload_progress
  5.     heap use-after-free disclosed 2026-10 (PHP security release 2026-10-21,
  6.     two CVSS 9.2 issues; third-party tracking CVE-2026-109618 / CVE-2026-109619,
  7.     UNVERIFIED pending the official php.net advisory).
  8.  
  9.     VALIDATED 2026-10-21 (lab, Proxmox VM 3013, Debian 13 / nginx / PHP 8.4.26):
  10.       - 0 false positives on REAL benign session.upload_progress upload traffic
  11.         (captured nginx access.log + real multipart body, 1 file part).
  12.       - 3/3 true positives on synthetic exploit artifacts (toolkit file,
  13.         grooming body with 40 parts, FPM SIGSEGV log line).
  14.       - Fixed during validation: rule 3 crash marker was "child exited on
  15.         signal 11" which NEVER matches real FPM logs ("child <PID> exited on
  16.         signal 11"); corrected to "exited on signal 11" + "SIGSEGV".
  17.       Still NOT validated against a real exploit (none run) or the official patch.
  18.  
  19.     STATUS: pre-advisory heuristics, written from publicly-described behavior
  20.     only. No official root cause or patch existed at authoring time. RE-TUNE
  21.     against the official advisory + patch diff once published (14:00 UTC
  22.     2026-10-21), and validate against your own benign upload traffic before
  23.     enforcing — the legitimate session.upload_progress feature uses the SAME
  24.     field name, so rule 2/3 WILL false-positive on normal uploads without the
  25.     grooming/racing qualifiers.
  26.  
  27.     Scope:
  28.       rule 1  exploit toolkit / PoC artifacts on disk
  29.       rule 2  multipart request body showing heap-grooming abuse of the handler
  30.       rule 3  captured HTTP log line pattern (access/proxy/WAF text logs)
  31. */
  32.  
  33. import "math"
  34.  
  35. rule PHP_SessionUploadProgress_UAF_Toolkit
  36. {
  37.     meta:
  38.         description = "Files of an exploit toolkit targeting the PHP session.upload_progress UAF"
  39.         author = "cirsec"
  40.         date = "2026-10-21"
  41.         reference = "https://www.php.net/archive/2026.php (advance notice 2026-10-20)"
  42.         severity = "high"
  43.         confidence = "medium"
  44.     strings:
  45.         // the handler field the exploit must reference (anchor)
  46.         $feat2 = "PHP_SESSION_UPLOAD_PROGRESS" ascii
  47.         // self-assigned (unverified) CVE tags seen in third-party PoC
  48.         $cve1 = "CVE-2026-109618" ascii nocase
  49.         $cve2 = "CVE-2026-109619" ascii nocase
  50.         // heap-manipulation / race vocabulary typical of a UAF weaponization
  51.         $uaf1 = "use-after-free" ascii nocase
  52.         $uaf2 = "use after free" ascii nocase
  53.         $groom1 = "heap spray" ascii nocase
  54.         $groom2 = "heap groom" ascii nocase
  55.         $groom3 = "defragment" ascii nocase
  56.         $race1 = "race" ascii nocase
  57.         $tgt1 = "8.4.4" ascii
  58.         $tgt2 = "8.2.34" ascii
  59.     condition:
  60.         filesize < 5MB
  61.         and $feat2
  62.         and (
  63.             any of ($cve*)
  64.             or (any of ($uaf*) and any of ($groom*))
  65.             or (any of ($groom*) and $race1 and any of ($tgt*))
  66.         )
  67. }
  68.  
  69. rule PHP_SessionUploadProgress_UAF_MultipartAbuse
  70. {
  71.     meta:
  72.         description = "Captured multipart/form-data body abusing session.upload_progress for heap grooming (UAF trigger)"
  73.         author = "cirsec"
  74.         date = "2026-10-21"
  75.         severity = "high"
  76.         confidence = "low"   // legitimate uploads share the field name; needs the grooming qualifier
  77.         note = "Run over captured request bodies (e.g. mod_security SecAuditLog, tcpdump -A, pcap text export), not live traffic."
  78.     strings:
  79.         $mp = "Content-Type: multipart/form-data" ascii nocase
  80.         // the progress trigger field, which MUST be first in the body to arm the handler
  81.         $trigger = "name=\"PHP_SESSION_UPLOAD_PROGRESS" ascii
  82.         // grooming indicators: many filename parts / repeated progress fields in one body
  83.         $part = "Content-Disposition: form-data;" ascii
  84.         $fn = "filename=\"" ascii
  85.     condition:
  86.         $mp and $trigger
  87.         // abnormal fan-out of parts in a single body = grooming, not a normal 1-2 file upload
  88.         and ( #part > 24 or #fn > 24 )
  89. }
  90.  
  91. rule PHP_SessionUploadProgress_UAF_LogPattern
  92. {
  93.     meta:
  94.         description = "Access/WAF text-log evidence of repeated POSTs driving session.upload_progress (possible UAF racing)"
  95.         author = "cirsec"
  96.         date = "2026-10-21"
  97.         severity = "medium"
  98.         confidence = "low"
  99.         note = "Heuristic over text logs; correlate with 5xx spikes / FPM worker crashes before acting."
  100.     strings:
  101.         $post = "POST " ascii
  102.         $ct = "multipart/form-data" ascii nocase
  103.         $field = "PHP_SESSION_UPLOAD_PROGRESS" ascii
  104.         // worker-death markers that accompany a UAF being hit.
  105.         // NB: FPM logs carry the PID ("child 2402 exited on signal 11"), so the
  106.         // marker must NOT include "child" — match the stable tail only.
  107.         $crash1 = "exited on signal 11" ascii nocase
  108.         $crash2 = "SIGSEGV" ascii           // FPM/kernel segfault report
  109.         $crash3 = "segfault at" ascii nocase // kernel dmesg line
  110.         $crash4 = "AH01067" ascii           // Apache: Failed to read FastCGI header
  111.         $crash5 = "AH01075" ascii           // Apache: Error dispatching to backend
  112.         $crash6 = "Connection reset by peer" ascii nocase
  113.     condition:
  114.         $post and $ct and $field and any of ($crash*)
  115. }
  116.  
Advertisement
Add Comment
Please, Sign In to add comment