php / php/php-src

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

Open
#18,845 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Category: Engine Status: Verified
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied script with the php-fuzz-execute driver. Read Zend/zend_lazy_objects.c around zend_lazy_object_init and trace the property access through Zend/zend_object_handlers.c, then review the fuzzer entry points in sapi/fuzzer/fuzzer-execute-common.h and sapi/fuzzer/fuzzer-sapi.c. Done means the reproducer no longer triggers the assertion, with regression coverage if an appropriate test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.