PMASA-2013-6

Announcement-ID: PMASA-2013-6

Date: 2013-06-05


Summary
XSS due to unescaped HTML output in Create View page.
Description

When creating a view with a crafted name and an incorrect CREATE statement, it is possible to trigger an XSS.


Severity
We consider this vulnerability to be non critical.
Mitigation factor

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


Affected Versions
Versions 4.0.x are affected.


Solution
Upgrade to phpMyAdmin 4.0.3 or newer, or apply the patch listed below.


References

Thanks to Maxim Rupp for reporting this issue.

Assigned CVE ids: CVE-2013-3742

CWE ids: CWE-661 CWE-79 

view_create.php
@@ -114,7 +114,8 @@
             $response->addJSON(
                 'message',
                 PMA_Message::error(
-                    "<i>$sql_query</i><br /><br />" . PMA_DBI_getError()
+                    "<i>" . htmlspecialchars($sql_query) . "</i><br /><br />"
+                    . PMA_DBI_getError()
                 )
             );
             $response->isSuccess(false);