显示 HN:PHP 8 禁用函数绕过 PoC
Show HN: PHP 8 disable_functions bypass PoC

原始链接: https://github.com/m0x41nos/TimeAfterFree

PHP 8 沙箱逃逸 PoC,演示了在类 Unix 系统上绕过 disable_functions。此漏洞利用使用后释放漏洞来绕过 disable_functions 并执行系统命令。用于泄漏堆指针和获取读/写原语的利用技术利用了 DateInterval 对象。该 PoC 在多个标准 PHP 发行版和常见服务器 API(CLI、PHP-FPM、Apache 模块)上进行了测试,并且可以确定性地重现。PHP 8.2.x PHP 8.3.x PHP 8.4.x PHP 8.5.x PHP 核心是不安全的,典型的 PHP 部署中的内存损坏是可以利用的。虽然一些 PHP 内存损坏问题和利用策略是公开的,但另一些则不是。依赖于 disable_functions 等沙箱机制来保障安全是异想天开。此仓库中的 PoC 仅用于教育和研究目的。作者不认可或鼓励任何未经授权的系统访问。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 展示 HN:PHP 8 disable_functions 绕过 PoC (github.com/m0x41nos) 15 分,由 m0x41nos 发布 48 分钟前 | 隐藏 | 过去 | 收藏 | 2 条评论 帮助 calvinmorrison 0 分钟前 | 下一个 [–] 不错的发现。人们对此依赖性有点过高,手册中只说“此指令允许禁用某些函数”,但它不是安全沙箱。我认为 PHP 过去曾明确表示它不是安全特性。多年来一直存在一些问题。总之 - 运行软件时需要良好的操作系统安全!回复 altairprime 12 分钟前 | 上一个 [–] 请详细说明你是如何搜索并发现这个漏洞的?你通常使用 PHP 吗?你使用了什么披露流程?回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

PHP 8 sandbox escape PoC demonstrating a disable_functions bypass on Unix-like systems.

This exploit leverages a use-after-free bug to bypass disable_functions and execute system commands. The exploitation techniques used for leaking heap pointers and obtaining read/write primitives utilize the DateInterval object.

The PoC was tested across multiple standard PHP distributions and common server APIs (CLI, PHP-FPM, Apache module) and reproduces deterministically.

exploit demo

  • PHP 8.2.x
  • PHP 8.3.x
  • PHP 8.4.x
  • PHP 8.5.x

PHP core is memory-unsafe, and memory corruption in typical PHP deployments is exploitable. While some PHP memory corruption issues and exploitation strategies are publicly known, others are not. Relying on sandboxing mechanisms such as disable_functions for security is wishful thinking.

The PoC in this repository is provided strictly for educational and research purposes. The author does not endorse or encourage any unauthorized access to systems.

联系我们 contact @ memedata.com