A critical remote code execution vulnerability in WordPress plugin Ad Inserter, let hackers execute arbitrary PHP code in the vulnerable installations.
The vulnerability was discovered by Wordfence security team and the vulnerability can be executed only by the authenticated users starting from Subscribers to above user levels.
The Ad Inserter used on over 200,000 websites and the functionality of the plugin to insert different kind of ads, opt-in forms and other scripts on the WordPress websites.
This issue is categorized as a critical one and has CVSS Score 9.9, the websites running Ad Inserter 2.4.21 or below are affected.
Wordfence reported the vulnerability to the plugin developer and the patch was released in the next day itself, users are recommended to update with 2.4.22 right away.
With this plugin, an ad preview feature option available which let’s website administrators to see how their ad appears on the web page.
This action can be done only by the website by authenticated users and also the plugin has check_admin_referer(), which ensures the action to be done by site administrator only.
But the vulnerability discovered by Wordfence shows that security control in place: check_admin_referer() is not enough and the nonce has been compromised to get the appropriate privileges.
By having the nonce string in hand, an attacker with Subscriber or above user account can exploit the vulnerability in ad preview feature by executing malicious PHP code, explains Wordfence.
By using tools such as WPScan you can scan the WordPress sites for vulnerabilities.