CVE-2008-2666

PHP < 5.2.6 - Directory Traversal via http URL Argument to chdir or ftok

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2008-2666. PoCs published by Maksymilian Arciemowicz.

AI-analyzed exploit summary This exploit demonstrates a PHP safe_mode bypass vulnerability (CVE-2008-2666) by using a URL path traversal technique (http://../../etc/) to bypass directory restrictions. It allows an attacker to change directories to unauthorized locations despite safe_mode restrictions.

Description

Multiple directory traversal vulnerabilities in PHP 5.2.6 and earlier allow context-dependent attackers to bypass safe_mode restrictions by creating a subdirectory named http: and then placing ../ (dot dot slash) sequences in an http URL argument to the (1) chdir or (2) ftok function.

Exploits (1)

exploitdb WORKING POC VERIFIED
by Maksymilian Arciemowicz · textlocalphp
https://www.exploit-db.com/exploits/31937

This exploit demonstrates a PHP safe_mode bypass vulnerability (CVE-2008-2666) by using a URL path traversal technique (http://../../etc/) to bypass directory restrictions. It allows an attacker to change directories to unauthorized locations despite safe_mode restrictions.

Classification
Working Poc 100%
Attack Type
Auth Bypass
Complexity
Trivial
Reliability
Reliable
Target: PHP 5.2.6 (and potentially other versions)
No auth needed
Prerequisites: PHP safe_mode enabled · Ability to execute arbitrary PHP code on the target system
devstral-2 · analyzed Feb 16, 2026 Full analysis →

References (17)

Core 17
Core References
Third Party Advisory third-party-advisory x_refsource_secunia
http://secunia.com/advisories/35074
Third Party Advisory third-party-advisory x_refsource_secunia
http://secunia.com/advisories/32746
Mailing List vendor-advisory x_refsource_hp
http://marc.info/?l=bugtraq&m=125631037611762&w=2
Vendor Advisory x_refsource_confirm
http://support.apple.com/kb/HT3549
Third Party Advisory third-party-advisory x_refsource_sreason
http://securityreason.com/securityalert/3942
Third Party Advisory vendor-advisory x_refsource_gentoo
http://security.gentoo.org/glsa/glsa-200811-05.xml
Mailing List vendor-advisory x_refsource_hp
http://marc.info/?l=bugtraq&m=124654546101607&w=2
Third Party Advisory, VDB Entry mailing-list x_refsource_bugtraq
http://www.securityfocus.com/archive/1/501376/100/0/threaded
Third Party Advisory x_refsource_confirm
http://wiki.rpath.com/Advisories:rPSA-2009-0035
Third Party Advisory, VDB Entry vdb-entry x_refsource_bid
http://www.securityfocus.com/bid/29796
Mailing List vendor-advisory x_refsource_apple
http://lists.apple.com/archives/security-announce/2009/May/msg00002.html
Third Party Advisory, VDB Entry vdb-entry x_refsource_xf
https://exchange.xforce.ibmcloud.com/vulnerabilities/43198
US Government Resource third-party-advisory x_refsource_cert
http://www.us-cert.gov/cas/techalerts/TA09-133A.html
Third Party Advisory vdb-entry x_refsource_vupen
http://www.vupen.com/english/advisories/2009/1297
Third Party Advisory, VDB Entry vdb-entry x_refsource_sectrack
http://www.securitytracker.com/id?1020328
Third Party Advisory third-party-advisory x_refsource_secunia
http://secunia.com/advisories/35650
Third Party Advisory third-party-advisory x_refsource_sreasonres
http://securityreason.com/achievement_securityalert/55

Scores

EPSS 0.1392
EPSS Percentile 96.1%

Details

CWE
CWE-22
Status published
Products (21)
php/php 5.0 rc1 (3 CPE variants)
php/php 5.0.0
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
... and 11 more
Published Jun 20, 2008
Tracked Since Feb 18, 2026