exploit:
setup.php?>'"><script>alert('xss');</script>
reason:
$_SERVER['REQUEST_URI'] is not escaped before printed out
solution:
add htmlspecialchars()
original report:
Security team-
In the course of assessing one of our clients, I discovered a XSS flaw in the setup.php page of phpMyAdmin. More information is provided in the advisory below. Please confirm that you have received this.
The DigiTrust Group Advisory 071009a: phpMyAdmin
Product:
phpMyAdmin 2.11.1
Credits:
Omer Singer
The DigiTrust Group
http://www.digitrustgroup.com
October 9, 2007
Risk Level:
MEDIUM - Vulnerability can be exploited to execute arbitrary HTML and script code in a user's browser session in context of an affected site.
Program Summary:
phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the Web. http://www.phpmyadmin.net/
Cross-site Scripting Vulnerability:
http://target-domain.com/phpMyAdmin-2.11.1/scripts/setup.php?>'"><script>alert('xss');</script>
Vendor Response:
In progress.
Vendor Solution:
n/a.
Copyright (c) 2007 The DigiTrust Group.
Permission is granted for the redistribution of this alert electronically. It may not be edited in any way without the express written consent of The DigiTrust Group.
Disclaimer: The information in the advisory is believed to be accurate at the time of publishing based on currently available information. Use of the information constitutes acceptance for use on an AS IS condition.
There are no warranties with regard to this information. Neither the author nor the publisher accepts any liability for any direct, indirect, or consequential loss or damage arising from use of, or reliance on, this information.
Logged In: YES
user_id=326580
Originator: YES
Fixed in subversion, thanks for reporting.
patch for 2.11.1, 2.11. and trunk (should work on most older versions too)
Logged In: YES
user_id=326580
Originator: YES
File Added: patch_xss_setup.php.diff
Logged In: YES
user_id=210714
Originator: NO
We were only able to trigger this under Internet Explorer when the setting 'send URLs as UTF8' is disabled (thanks Sebastian).
2.11.1.1 is being released.
Patch is available here:
http://phpmyadmin.svn.sourceforge.net/viewvc/phpmyadmin/branches/MAINT_2_11_1/phpMyAdmin/scripts/setup.php?r1=10637&r2=10748&view=patch