php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76244 A stack overflow vulnerability exist (most likely) in the isSet function
Submitted: 2018-04-20 11:12 UTC Modified: 2018-04-23 03:34 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: daniel dot teuchert at rub dot de Assigned:
Status: Open Package: *Programming Data Structures
PHP Version: 7.2.4 OS: Linux 4.6.2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-04-20 11:12 UTC] daniel dot teuchert at rub dot de
Description:
------------
Calling isSet with too many parameters causes a stack overflow.
Executing the test script results in a stack overflow.
The produced ASAN output can be found here: https://github.com/pnoltof/php_bug/blob/master/ASAN_output.txt
An attacker can possibly use this flaw to execute arbitrary code.

Steps to reproduce:
Build latest php version (compile with ASAN)
Donwload PoC file called "stack_overflow" (see Test script)
Execute binary file in $WORKDIR/php-7.2.4/sapi/cli/:
$WORKDIR/php-7.2.4/sapi/cli/php stack_overflow

I was not able to reproduce this behavior when debugging with gdb.

Test script:
---------------
PoC file can be found here: https://github.com/pnoltof/php_bug/blob/master/stack_overflow


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-22 22:16 UTC] cmb@php.net
This does not look like a security issue, since checking so many
variables in a single isset() does not appear to be of any
practical purpose.
 [2018-04-23 03:34 UTC] stas@php.net
-Type: Security +Type: Bug
 [2018-04-23 03:34 UTC] stas@php.net
Not a security issue, please see https://wiki.php.net/security
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 21:01:28 2019 UTC