php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80072 Cyclic unserialize in TMPVAR operand may leak
Submitted: 2020-09-07 08:53 UTC Modified: -
From: nikic@php.net Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 8.0Git-2020-09-07 (Git) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nikic@php.net
New email:
PHP Version: OS:

 

 [2020-09-07 08:53 UTC] nikic@php.net
Description:
------------
<?php
$s = 'O:8:"stdClass":1:{s:1:"x";r:1;}';
unserialize($s) % gc_collect_cycles();

This leaks the cyclic object, as we destroy TMPVAR operands with zval_ptr_dtor_nogc(). The unserialize() implementation manually registers a GC root for the return value, but the gc_collect_cycles() call here drops it again, because the cycle is not dead at the time of the call yet.

This is oss-fuzz #25441.


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Oct 27 12:01:22 2020 UTC