Late last week, Ninja Forms users received a forced security update from WordPress.org for a critical PHP Object Injection vulnerability. This particular vulnerability can be exploited remotely without any authentication. It was publicly disclosed last week and patched in the latest version, 3.6.11. Patches were also backported to versions 220.127.116.11, 3.1.10, 3.2.28, 18.104.22.168, 22.214.171.124, and 126.96.36.199.
Wordfence noticed a back-ported security update in the form builder plugin, which has more than a million active installs. Threat analyst Chloe Chamberland explained the vulnerability in an advisory alerting the company’s users:
We uncovered a code injection vulnerability that made it possible for unauthenticated attackers to call a limited number of methods in various Ninja Forms classes, including a method that unserialized user-supplied content, resulting in Object Injection. This could allow attackers to execute arbitrary code or delete arbitrary files on sites where a separate POP chain was present.
The vulnerability affects Ninja Forms’ “Merge Tags” feature that auto-populates values from Post IDs and usernames, for example. Wordfence threat analyst Ramuel Gall reverse engineered the vulnerability’s patches to create a working proof of concept. He found that it is possible to call various Ninja Forms classes that could be used for a wide range of exploits, including complete site takeover. Chamberland reports there is evidence to suggest the vulnerability is being actively exploited in the wild.
WordPress.org’s forced security updates are a mitigation effort used in rare instances where the vulnerability is particularly severe and affects a large number of users. More than 680,000 sites were updated on June 14. This PHP object injection vulnerability scores 9.8 on the Common Vulnerability Scoring System, but it has not yet been given a CVE ID.
Reviewing previous CVE ID’s for Ninja Forms, this is the most severe vulnerability in the plugin’s history. Ninja Forms’ changelog doesn’t communicate the severity of the threat, categorizing it as a “security enhancement:”
3.6.11 (14 JUNE 2022)
* Apply more strict sanitization to merge tag values
Ninja Forms did not post about the security update on its blog or social media accounts. Wordfence plans to update the text of its advisory as the company learns more about how attackers are exploiting the vulnerability. Ninja Forms users should check their sites to ensure the automatic security update went through. This update comes just one week after Ninja Forms patched a less severe, authenticated stored cross-site scripting (XSS) vulnerability on June 7.