Ninja Forms Contact Form <= 3.7.1 - Unauthenticated Second Order SQL Injection
Strategic Overview
- Status
- Patched in 3.7.2
- Affected Plugin
- Ninja Forms – The Contact Form Builder That Grows With You
- Affected Version
<= 3.7.1- CVSS
- 5.9Medium
- Weakness type
- CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
- CVE
CVE-2024-0685
At a glance
CVE-2024-0685 is a medium-severity Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in the Ninja Forms WordPress plugin, affecting versions <= 3.7.1. It carries a CVSS score of 5.9 (reachable over the network; high confidentiality impact). Exploitation requires no authentication. The issue is fixed in version 3.7.2; sites on affected versions should update now. Disclosed February 2024, reported by stealthcopter.
Vulnerability Overview
The Ninja Forms Contact Form – The Drag and Drop Form Builder for WordPress plugin for WordPress is vulnerable to Second Order SQL Injection via the email address value submitted through forms in all versions up to, and including, 3.7.1 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to inject SQL in their email address that will append additional into the already existing query when an administrator triggers a personal data export.
Technical Analysis
The vector marks this flaw as remotely reachable over the network, and no privileges on the target site, and no interaction from a victim user. A successful exploit has high impact on confidentiality.
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Reaching this weakness in Ninja Forms <= 3.7.1 takes no account at all. SQL injection happens when request data is concatenated into a query instead of being bound as a parameter, letting an attacker change the structure of the statement rather than just its values.
A working injection can read any table the database user can see, which on a WordPress install means user records, password hashes and session or API secrets stored in options. For Ninja Forms the fix is 3.7.2: builds <= 3.7.1 are affected, anything from 3.7.2 onward is not.
Remediation
Update to version 3.7.2, or a newer patched version
How does WordSec protect against this?
Requests carrying this pattern arrive without a session, so nothing upstream of the firewall gets a chance to reject them: WordSec's web application firewall inspects request payloads before WordPress loads them. None of that substitutes for the fix: Ninja Forms 3.7.2 closes this, and updating the plugin is the step that ends it.
- Firewall
- Login Security
- Alerts
External References
Related records
Same weakness class
Other vulnerabilities in Ninja Forms – The Contact Form Builder That Grows With You
- 9.8Ninja Forms Contact Form Code Injection
- 9.8CVE-2016-1209: Ninja Forms Contact Form… Arbitrary File Upload
CVE-2016-1209 - 9.1CVE-2018-20981: Ninja Forms Insufficient Restrictions during Export
CVE-2018-20981 - 8.8Ninja Forms Contact Form CSRF to Field Import and PHP Object Injection
- 8.8CVE-2021-24163: Ninja Forms Contact Form SendWP Plugin Installation
CVE-2021-24163 - 8.8CVE-2020-36174: Ninja Forms Contact Form CSRF to Plugin Installation
CVE-2020-36174 - 8.6CVE-2018-16308: Ninja Forms Contact Form <= 3.3.13 CSV Injection
CVE-2018-16308 - 8.4Ninja Forms Contact Form <= 2.9.27 CSV Injection
Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C