Our Proactive Monitoring Caught a PHP Object Injection Vulnerability in WC Designer
One way we help to improve the security of WordPress plugins, not just for our 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. Through that, we caught ones of those vulnerabilities, a PHP object injection vulnerability, in the plugin WC Designer.
The possibility of this vulnerability is also flagged by our Plugin Security Checker, so you can check plugins you use to see if they might have similar issues with that tool.
We tested and confirmed that our new firewall plugin for WordPress protected against the proof of concept below, even before we discovered the vulnerability, as part of its protection against zero-day vulnerabilities.
PHP Object Injection
The automated portion of that monitoring flagged the following line of code because of the possibility that it could permit PHP object injection to occur:
942 | $_wishlist = unserialize( stripslashes( $_COOKIE[ $_wishlist_key ] ) ); |
That code is in the function woolementor_get_wishlist() in the file /functions/helpers.php:
934 935 936 937 938 939 940 941 942 | function woolementor_get_wishlist( $user_id = 0 ) { $_wishlist_key = '_woolementor-wishlist'; $_wishlist = []; if( $user_id != 0 ) { $_wishlist = get_user_meta( $user_id, $_wishlist_key, true ) ? : []; } elseif( isset( $_COOKIE[ $_wishlist_key ] ) ) { $_wishlist = unserialize( stripslashes( $_COOKIE[ $_wishlist_key ] ) ); |
So the value of the COOKIE input “_woolementor-wishlist” will be unserialized if the variable $user_id is set to 0.
That function is called in multiple places in the pluigin. One of those in the code for the plugin’s Shop Classic widget, where the $user_id is set to 0 if the request comes from someone not logged in:
1945 1946 | $user_id = get_current_user_id(); $wishlist = woolementor_get_wishlist( $user_id ); |
Through that unserialization, PHP objection can occur, as can be confirmed with the proof of concept below.
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.
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).
If the moderation is cleaned up, it would also allow the possibility of being able to use the forum to start discussing fixing the problems caused by the very problematic handling of security by the team running the Plugin Directory, discussions which they have for years shut down through their control of the Support Forum.
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
With our plugin for testing for PHP object injection installed and activated, set the value of the cookie “_woolementor-wishlist” to “O:20:”php_object_injection”:0:{}” and then when visiting a page with the plugin’s Shop Classic widget and not logged in, the message “PHP object injection has occurred.” will be shown.