重大 PHP 漏洞泄露
PHP session.upload_progress heap UAF (CVE-2026-109618 / -109619)

原始链接: https://jackalsyn.com/posts/php-up-2026.html

PHP 的 `session.upload_progress` 在 `php_session_rfc1867_callback` 中存在 use-after-free,它将两个 `zval` 桶指针缓存到活动的 HashTable 中。后续更新重新解码会话文件并释放先前树,留下可能被回收以调用 `zend_call_function`/`system()` 的悬空指针。已在 PHP 8.4.4 和 8.2.34 验证,并提供发行版符号差异。立即通过禁用 `session.upload_progress.enabled`、在边缘限制 multipart 上传、清点 PHP 版本,并在可用时升级到修补版本(8.5.11/8.4.26/8.3.35/8.2.34)来缓解。小团队应立即应用权宜措施。

Hacker News 新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 重大 PHP 漏洞泄露 (jackalsyn.com) 32 分,由 rfarley04 发布于 1 小时前 | 隐藏 | 过去 | 收藏 | 4 条评论 帮助 drum55 4 分钟前 | 下一个 [–] 这篇文章基本不可读,哪怕有一点人类作者的写作都更好。 回复 Davidzheng 3 分钟前 | 父评论 | 下一个 [–] 是的,同意。 回复 80fj0348i 7 分钟前 | 上一个 [–] 之前以更好的来源提交过:https://news.ycombinator.com/item?id=50172041 回复 tech234a 2 分钟前 | 父评论 [–] 这个声称是实际漏洞利用。另一个只是 PHP 的公告,没有细节。 回复 考虑申请 YC 2027 冬季批次!申请开放至 11 月 2 日。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Overview

Two cached bucket pointers, one freed tree. A heap use-after-free in PHP session.upload_progress reaching zend_call_function.

PHP's session.upload_progress handler (php_session_rfc1867_callback in ext/session/session.c) caches two raw zval * bucket pointers into live HashTables: post_bytes_processed and current_file_bytes_processed. Both point into arrays that the request lifecycle frees under the attacker's feet. Press [SOURCE] above to walk the full bundle: the trigger request, both PoC chains, the extraction harness, and the validated per-build symbol deltas.

Stock configuration is enough. session.upload_progress.enabled=1 and the default name, prefix, freq=1%, min_freq=1. A single fast multipart POST arms both caches; a second update() re-reads the session file and zend_hash_update destroys the previous decoded tree through its HashTable destructor zval_ptr_dtor. The freed bucket is then reclaimed and the stale pointer lands an attacker-shaped zend_fcall_info / zend_internal_function that calls zend_call_function, i.e. system().

All of the following is verified against real php-src (8.4.4 and 8.2.34): every line reference in the original writeup, the ZVAL_COPY_VALUE no-addref moves, the re-decode/track_init free, and the struct offsets (zend_fcall_info 64B with param_count at +48, zend_internal_function.handler at +88, IS_STRING_EX 0x106, IS_OBJECT_EX 0x308).

The framework in this post bakes in per-build delta extraction (--syms) because the offset between zval_ptr_dtor and zend_call_function changes with every build. Official LiteSpeed lsphp82 8.2.34 debug symbols give the exact values for the three distro sub-builds (bookworm 0xc930, noble 0xcef0, jammy 0xd060) and are included below.

Mitigation (pre-patch)

What to do before the official advisory ships. You can do all of this tonight.

1. Inventory your PHP

Know every host and version (php -v). Anything on PHP 7.x or older won't get a fix, so plan to upgrade.

2. Apply the stopgap (best-intel, low-risk, reversible)

In php.ini / .user.ini / .htaccess:

php.ini [stopgap]

session.upload_progress.enabled = Off

Reload PHP-FPM or your web server. My analysis says this closes one of the two likely paths.

3. Clamp multipart uploads at the edge

The second likely path lives in the multipart parser itself, which runs for any multipart/form-data POST regardless of the setting above. If you've got a WAF or reverse proxy, tighten inspection or rate-limit multipart POSTs to endpoints that don't need uploads. This is the same network-layer mitigation the enterprise vendors are quietly deploying for their paying customers.

4. Patch the second it drops

Current stable: 8.5.11 / 8.4.26 / 8.3.35 / 8.2.34. If your hosting is managed, confirm your provider's timeline today.

Why I'm posting this for free

A pre-patch mitigation shouldn't be a subscription perk. I'm a one man shop, and the orgs most likely to get burned in the gap between leak and patch are the small teams without an enterprise threat intel contract. The steps above cost nothing. Spend tonight reducing risk, not tomorrow doing incident response.

I'll follow up once the official advisory publishes and confirm whether my root cause read was right, together with Andrew Dorman (@acd421) and Arch&Yuki (@ArchKnight23).

联系我们 contact @ memedata.com