Lazy object reset with object destructor can lead to use-after-free
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
Start by reading Zend/zend_lazy_objects.c around zend_object_make_lazy at line 338, then compare the resetAsLazyGhost() and resetAsLazyProxy() paths with the related re-entrant destruction issue #22399. Reproduce with the supplied PHP snippet under AddressSanitizer; done means both reset methods avoid the heap-use-after-free.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Description
Originally reported by @cnwangjihe.
The re-entrant property destruction issue reported in #22399 also affects ReflectionClass::resetAsLazyGhost() and ReflectionClass::resetAsLazyProxy().
The following code:
<?php
class Target {
public ?Trigger $trigger = null;
}
class Trigger {
public function __construct(private object $target) {}
public function __destruct() {
unset($this->target->trigger);
}
}
$reflection = new ReflectionClass(Target::class);
$target = new Target();
$target->trigger = new Trigger($target);
$reflection->resetAsLazyGhost($target, static function (): void {});
Resulted in this output:
ERROR: AddressSanitizer: heap-use-after-free
zend_object_make_lazy Zend/zend_lazy_objects.c:338
But I expected this output instead:
PHP Version
PHP 8.4+
Operating System
No response
- Linguagem predominante
- C
- Estrelas
- 40.7k
- Forks
- 8.3k
- Merge médio
- 2d 16h
- PRs com merge (30d)
- 151
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de php/php-src
-
sapi/fpm/tests/tester.inc can send SIGUSR2 to pid 0, killing run-tests.phpTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. AbertaBug Status: Needs Triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
zend_set_local_var() overwrites existing compiled variable (CV) zval without calling zval_ptr_dtor()Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. AbertaBug Status: Needs Triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
Case-insensitive substr_compare, ksort, krsort are still locale-dependentTalvez já em andamento @lazerg assumiu há 3 dias. AbertaBug Extension: standard Status: Verified
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
php/php-src#24552 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
master: part of the mbstring bailout fix got lost in a mergeTalvez já em andamento @lazerg assumiu há 4 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
Todas as issues de php/php-src
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
AOMediaCodec/SVT-AV1#3320 ·
-
Add `CPC_TAKE_TILL_CHARS`Abertadifficulty: easy
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
-
ML-KEM: OQS_KEM_encaps/decaps cannot do the FIPS 203 length (type) checks; please document itAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
open-quantum-safe/liboqs#2647 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
Broken links in the docsAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia