phpMyAdmin 3.5.2.2 from the SourceForge mirror cdnetworks-kr-1 held a new file that runs any PHP code a visitor sends, in September 2012.
The bad zip was phpMyAdmin-3.5.2.2-all-languages.zip. The flaw has the id CVE-2012-5159.
What happened
One SourceForge mirror served a copy of phpMyAdmin with a backdoor that the official release did not have.
- The zip held a new file,
server_sync.php, that runs remote PHP code. - An attacker sends an HTTP POST request to the file with a parameter
cthat holds the payload as hex. - The attack needs no login.
- The zip also changed
js/cross_framing_protection.js.
The phpMyAdmin team published advisory PMASA-2012-5 on 25 September 2012. A public exploit appeared on 10 October 2012.
Affected versions
- phpMyAdmin 3.5.2.2, only the file
phpMyAdmin-3.5.2.2-all-languages.zipfrom thecdnetworks-kr-1SourceForge mirror. - The GitHub advisory lists the version ranges as unknown. Use the presence of
server_sync.phpas the test.
Indicators of compromise
- A file named
server_sync.phpin the phpMyAdmin folder. The genuine release does not have it. - A modified
js/cross_framing_protection.js. - HTTP POST requests to
/server_sync.phpwith a parameterc=in your web server logs (Exploit-DB).
How to check
Search the web root for the backdoor file. Change the path to your own web root.
find /var/www -name server_sync.php
Search the web server logs for requests to the file. Use the log path of your server.
grep "server_sync.php" /var/log/apache2/access.log*
What to do now
- Search for
server_sync.phpin every phpMyAdmin install. - If the file exists, delete the old install folder and download phpMyAdmin again from a trusted mirror.
- If the logs show POST requests to the file, treat the server as compromised. Rotate database and server credentials.
- Check the checksum or signature against the official release before you install.
Frequently asked questions
Which phpMyAdmin version had the backdoor?
phpMyAdmin 3.5.2.2, only the zip from the cdnetworks-kr-1 SourceForge mirror.
How do I know if my install has the backdoor?
Look for a file named server_sync.php in the phpMyAdmin folder. The genuine release does not have it.
What does server_sync.php do?
It runs PHP code that a remote attacker sends in an HTTP POST request. No login is needed.
Sources
Send this page to the person who looks after AI at your company.