Bug 519266 (CVE-2008-7068)

Summary: CVE-2008-7068 php: dba_replace() file corruption vulnerability
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: jorton
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-7068
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-25 21:42:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vincent Danen 2009-08-25 21:07:56 UTC
Common Vulnerabilities and Exposures assigned an identifier CVE-2008-7068 to
the following vulnerability:

Name: CVE-2008-7068
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-7068
Assigned: 20090824
Reference: SREASONRES:20081127 PHP 5.2.6 dba_replace() destroying file
Reference: URL: http://securityreason.com/achievement_securityalert/58
Reference: BUGTRAQ:20081127 SecurityReason : PHP 5.2.6 dba_replace() destroying file
Reference: URL: http://www.securityfocus.com/archive/1/archive/1/498746/100/0/threaded
Reference: BUGTRAQ:20081206 Re: SecurityReason : PHP 5.2.6 dba_replace() destroying file
Reference: URL: http://www.securityfocus.com/archive/1/498981/100/0/threaded
Reference: BUGTRAQ:20081206 Re: SecurityReason : PHP 5.2.6 dba_replace() destroying file
Reference: URL: http://www.securityfocus.com/archive/1/498982/100/0/threaded
Reference: CONFIRM: http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1313&r2=1.2027.2.547.2.1314&
Reference: OSVDB:52206
Reference: URL: http://www.osvdb.org/52206
Reference: XF:php-dbareplace-file-corruption(47316)
Reference: URL: http://xforce.iss.net/xforce/xfdb/47316

The dba_replace function in PHP 5.2.6 and 4.x allows context-dependent
attackers to cause a denial of service (file truncation) via a key
with the NULL byte.  NOTE: this might only be a vulnerability in
limited circumstances in which the attacker can modify or add database
entries but does not have permissions to truncate the file.

Comment 1 Vincent Danen 2009-08-25 21:34:12 UTC
This is not a security issue.  A user with read and write access to a file can reasonably be expected to manipulate the contents of the file, including truncating it.  Instead of using dba_replace(), a user could simply fopen() the file in write mode and write an empty string to it, which provides the same end-result.

Comment 2 Vincent Danen 2009-08-25 21:45:19 UTC
For posterity, the patch to fix this issue is here: http://cvs.php.net/viewvc.cgi/php-src/ext/dba/libinifile/inifile.c?r1=1.14.2.1.2.4&r2=1.14.2.1.2.5&view=patch

Comment 3 Tomas Hoger 2009-08-27 08:02:22 UTC
Further discussion about the issue:
  http://thread.gmane.org/gmane.comp.security.oss.general/1438