A WordPress anti-spam plugin with over 60,000 installations patched a PHP Object injection vulnerability that arose from improper sanitization of inputs, subsequently allowing base64 encoded user input.
Unauthenticated PHP Object Injection
A vulnerability was discovered in the popular Stop Spammers Security | Block Spam Users, Comments, Forms WordPress plugin.
The purpose of the plugin is to stop spam in comments, forms, and sign-up registrations. It can stop spam bots and has the ability for users to input IP addresses to block.
It is a required practice for any WordPress plugin or form that accepts a user input to only allow specific inputs, like text, images, email addresses, whatever input is expected.
Unexpected inputs should be filtered out. That filtering process that keeps out unwanted inputs is called sanitization.
For example, a contact form should have a function that inspects what is submitted and block (sanitize) anything that is not text.
The vulnerability discovered in the anti-spam plugin allowed encoded input (base64 encoded) which can then trigger a type of vulnerability called a PHP Object injection vulnerability.
The description of the vulnerability published on the WPScan website describes the issue as:
“The plugin passes base64 encoded user input to the unserialize() PHP function when CAPTCHA are used as second challenge, which could lead to PHP Object injection if a plugin installed on the blog has a suitable gadget chain…”
The classification of the vulnerability is Insecure Deserialization.
The non-profit Open Web Application Security Project (OWASP) describes the potential impact of these kinds of vulnerabilities as serious, which may or may not be the case specific to this vulnerability.
The description at OWASP:
“The impact of deserialization flaws cannot be overstated. These flaws can lead to remote code execution attacks, one of the most serious attacks possible.
The business impact depends on the protection needs of the application and data.”
But OWASP also notes that exploiting this kind of vulnerability tends to be difficult:
“Exploitation of deserialization is somewhat difficult, as off the shelf exploits rarely work without changes or tweaks to the underlying exploit code.”
The vulnerability in the Stop Spammers Security WordPress plugin was fixed in version 2022.6
The official Stop Spammers Security changelog (a description with dates of various updates) notes the fix as an enhancement for security.
Users of the Stop Spam Security plugin should consider updating to the latest version in order to prevent a hacker from exploiting the plugin.
Read the official notification at the United States Government National Vulnerability Database:
Read the WPScan publication of details related to this vulnerability:
Stop Spammers Security < 2022.6 – Unauthenticated PHP Object Injection
Featured image by Shutterstock/Luis Molinero