php / php/php-src

Fuzzer `php-fuzz-execute` crashes at `zend_lazy_object_init`

未关闭
#18,845 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Category: Engine Status: Verified
主要语言
C
星标
40.4k
派生
8.1k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Description

The following code:

<?php
class Test {
    public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
    public function a($x) { }
}
$obj = new Test;
var_dump($obj->$name ?? 12);
?>

Resulted in this crashing call stack by the fuzzing driver php-fuzz-execute:

#6  __GI___assert_fail (assertion=0xdec74d "info", file=0xe24f2e "/src/php-src/Zend/zend_lazy_objects.c", line=110, function=0xe2576a "zend_lazy_object_info *zend_lazy_object_get_info(zend_object *)") at ./assert/assert.c:103
#7  zend_lazy_object_init () at Zend/zend_lazy_objects.c:513
#8  zend_std_read_property () at Zend/zend_object_handlers.c:954
#9   ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLER () at Zend/zend_vm_execute.h:52811
#10 fuzzer_execute_ex () at sapi/fuzzer/fuzzer-execute-common.h:59
#11 zend_execute () at Zend/zend_vm_execute.h:64385
#12 fuzzer_do_request_from_buffer () at sapi/fuzzer/fuzzer-sapi.c:274
#13 LLVMFuzzerTestOneInput () at sapi/fuzzer/fuzzer-execute.c:27
PHP Version
dbabbe180b157eeaac5002276667f1f56f0b4def 2025-06-10 22:35:56+0200
Operating System

Linux

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用 php-fuzz-execute 驱动复现提供的脚本。阅读 Zend/zend_lazy_objects.c 中 zend_lazy_object_init 附近的代码,并通过 Zend/zend_object_handlers.c 跟踪属性访问,然后检查 sapi/fuzzer/fuzzer-execute-common.h 和 sapi/fuzzer/fuzzer-sapi.c 中的 fuzzer 入口点。当 reproducer 不再触发 assertion,并且在确定了合适的测试位置时加入回归覆盖,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, php
领域
backend, testing-qa
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。