Sploitus

Exploit for phpMyAdmin preg_replace from_prefix sanitization vulnerability

saint · 2013-05-20

Exploit Code

MARKDOWN37 lines
## https://sploitus.com/exploit?id=SAINT:28A06F972AB8BA47E42AD5FC09425D08
Added: 05/20/2013  
CVE: CVE-2013-3238  
BID: 59460  
OSVDB: 92793  


### Background

phpMyAdmin is a free software tool, written in PHP, designed to handle the administration of MySQL over the Web. 

### Problem

phpMyAdmin before 3.5.8.1 is vulnerable to code injection as a result of failure to sanitize input passed via the `**from_prefix**` parameter passed to `**preg_replace()**` in `**libraries/mult_submits.inc.php**`. As a result, an authenticated remote attacker could potentially execute arbitrary code. 

### Resolution

Upgrade to phpMyAdmin 3.5.8.1 or newer. 

### References

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


### Limitations

This exploit was tested against phpMyAdmin Devel Team phpMyAdmin 3.5.8 on CentOS 6 (with Exec-Shield Enabled). 

Netcat (nc) must be installed on the target. 

Exploit requires a valid path to phpMyAdmin and valid user credentials for phpMyAdmin's web interface. 

Only phpMyAdmin running on a PHP version before 5.4.7 is vulnerable. Newer PHP versions will generate a warning. 

### Platforms

Linux