PHP symlink() open_basedir security bypass

php-openbasedir-security-bypass (29340) The risk level is classified as MediumMedium Risk

Description:

A race condition in PHP could allow a remote attacker to bypass open_basedir security restrictions. A remote attacker could exploit this vulnerability using the symlink() function to bypass open_basedir restrictions and gain unauthorized access to restricted files.

Platforms Affected:

  • MandrakeSoft, Mandrake Linux 2006
  • MandrakeSoft, Mandrake Linux 2006 X86_64
  • MandrakeSoft, Mandrake Linux 2007 X86_64
  • MandrakeSoft, Mandrake Linux 2007
  • MandrakeSoft, Mandrake Linux Corporate Server 3.0
  • MandrakeSoft, Mandrake Linux Corporate Server 3.0 X86_64
  • MandrakeSoft, Mandrake Linux Corporate Server 4.0
  • MandrakeSoft, Mandrake Linux Corporate Server 4.0 X86_64
  • MandrakeSoft, Mandrake Multi Network Firewall 2.0
  • OpenPKG, OpenPKG 2-STABLE
  • OpenPKG, OpenPKG CURRENT
  • OpenPKG, OpenPKG Enterprise E1.0-SOLID
  • PHP, PHP 5.0.0
  • PHP, PHP 5.0.0 Beta4
  • PHP, PHP 5.0.0 RC3
  • PHP, PHP 5.0.0 RC2
  • PHP, PHP 5.0.0 RC1
  • PHP, PHP 5.0.0 Beta3
  • PHP, PHP 5.0.0 Beta2
  • PHP, PHP 5.0.0 Beta1
  • PHP, PHP 5.0.1
  • PHP, PHP 5.0.2
  • PHP, PHP 5.0.3
  • PHP, PHP 5.0.4
  • PHP, PHP 5.0.5
  • PHP, PHP 5.1.0
  • PHP, PHP 5.1.1
  • PHP, PHP 5.1.2
  • PHP, PHP 5.1.3
  • PHP, PHP 5.1.4
  • PHP, PHP 5.1.5
  • PHP, PHP 5.1.6
  • Turbolinux, Turbolinux 10 Desktop
  • Turbolinux, Turbolinux 10 F...
  • Turbolinux, Turbolinux 10 Server
  • Turbolinux, Turbolinux 10 Server x64 Ed
  • Turbolinux, Turbolinux 8 Server
  • Turbolinux, Turbolinux Home
  • Turbolinux, Turbolinux Multimedia
  • Turbolinux, Turbolinux Personal
  • Turbolinux, Turbolinux
  • Turbolinux, Turbolinux Appliance Server 1.0 Hosting Ed
  • Turbolinux, Turbolinux Appliance Server 1.0 Workgroup Ed
  • Turbolinux, Turbolinux Appliance Server 2.0

Remedy:

For Turbolinux:
Refer to Turbolinux Security Advisory TLSA-2006-38 for patch, upgrade, or suggested workaround information. See References.

Consequences:

Bypass Security

References:

  • Full-Disclosure Mailing List, Tue Oct 03 2006 - 15:38:30 CDT, Advisory 08/2006: PHP open_basedir Race Condition Vulnerability at http://archives.neohapsis.com/archives/fulldisclosure/2006-10/0065.html.
  • BID-20326: PHP Symbolic Link Open_Basedir Bypass Vulnerability
  • CVE-2006-5178: 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.
  • MDKSA-2006:185: Updated php packages to address multiple vulnerabilities
  • OpenPKG-SA-2006.023: PHP
  • SA22235: PHP "open_basedir" Symlink Security Bypass Vulnerability
  • SECTRACK ID: 1016977: PHP Race Condition Lets Users Bypass open_basedir Restrictions

Reported:

Oct 03, 2006

The information within this database may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. In no event shall the author/distributor (IBM Internet Security Systems X-Force) be held liable for any damages whatsoever arising out of or in connection with the use or spread of this information.

For corrections or additions please email xforce@iss.net

Return to the main page