CVE-2024-0685

Ninja Forms Contact Form <= 3.7.1 - Unauthenticated Second Order SQL Injection

2024-02-01 00:00
stealthcopter

Strategic Overview

Status
Patched in 3.7.2
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
View all Ninja Forms – The Contact Form Builder That Grows With You vulnerabilities

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

Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C