Bug 956398 (CVE-2013-3238)

Summary: CVE-2013-3238 phpMyAdmin: remote code execution via preg_replace() (PMASA-2013-2)
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ccoleman, dmcphers, jialiu, lmeyer, redhat-bugzilla, tkramer
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: phpMyAdmin 3.5.8.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-15 04:30:25 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:
Bug Depends On: 956403, 956404, 956405    
Bug Blocks: 950112    

Description Vincent Danen 2013-04-24 21:42:16 UTC
In some PHP versions, the preg_replace() function can be tricked into executing arbitrary PHP code on the server. This is done by passing a crafted argument as the regular expression, containing a null byte. phpMyAdmin does not correctly sanitize an argument passed to preg_replace() when using the "Replace table prefix" feature, opening the way to this vulnerability.

This vulnerability can be triggered only by someone who logged in to phpMyAdmin, as the usual token protection prevents non-logged-in users to access the required form.

This is fixed via the following commits:

https://github.com/phpmyadmin/phpmyadmin/commit/dedd542cdaf1606ca9aa3f6f8f8adb078d8ad549
https://github.com/phpmyadmin/phpmyadmin/commit/ffa720d90a79c1f33cf4c5a33403d09a67b42a66


External References:

http://www.phpmyadmin.net/home_page/security/PMASA-2013-2.php

Comment 1 Vincent Danen 2013-04-24 21:51:08 UTC
Created phpMyAdmin tracking bugs for this issue

Affects: fedora-all [bug 956403]
Affects: epel-6 [bug 956404]

Comment 2 Vincent Danen 2013-04-24 21:51:12 UTC
Created phpMyAdmin3 tracking bugs for this issue

Affects: epel-5 [bug 956405]

Comment 3 Fedora Update System 2013-05-15 19:43:13 UTC
phpMyAdmin3-3.5.8.1-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2013-05-15 19:44:56 UTC
phpMyAdmin-3.5.8.1-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.