/

CVE-2022-51021

Severity:

HIGH RISK

(8.2)

SQL Injection (CWE-89) in NotificationX WordPress Plugin

CVE-2022-51021

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

NotificationX for WordPress contains an unauthenticated SQL injection vulnerability in a REST API endpoint that processes an attacker-controlled identifier. A remote attacker may manipulate database queries and retrieve database contents when the endpoint is reachable and request parameters are not safely validated or parameterized.

NotificationX for WordPress contains an unauthenticated SQL injection vulnerability in a REST API endpoint that processes an attacker-controlled identifier. A remote attacker may manipulate database queries and retrieve database contents when the endpoint is reachable and request parameters are not safely validated or parameterized.

Affected context

The vulnerability occurs in the NotificationX WordPress REST API endpoint responsible for retrieving notifications. It becomes risky when the endpoint is publicly accessible, accepts array-form identifier parameters, and passes resulting values into database query construction without effective validation or parameter binding. Exploitation does not generally require an authenticated WordPress account.

The vulnerability occurs in the NotificationX WordPress REST API endpoint responsible for retrieving notifications. It becomes risky when the endpoint is publicly accessible, accepts array-form identifier parameters, and passes resulting values into database query construction without effective validation or parameter binding. Exploitation does not generally require an authenticated WordPress account.

Exploit preconditions

  • Attack surface: Publicly reachable WordPress REST API endpoint
  • Required access: Remote network access; an authenticated account is not generally required
  • Trigger point: Processing of the notification identifier in the notification retrieval request
  • Why exploitation is possible: Attacker-controlled input can flow into a database WHERE-clause construction path without adequate sanitization or parameterization
  • Attack surface: Publicly reachable WordPress REST API endpoint
  • Required access: Remote network access; an authenticated account is not generally required
  • Trigger point: Processing of the notification identifier in the notification retrieval request
  • Why exploitation is possible: Attacker-controlled input can flow into a database WHERE-clause construction path without adequate sanitization or parameterization

Why this happens

The underlying flaw is improper neutralization of special SQL elements in externally supplied input. The endpoint accepts a structured identifier value, and a downstream database helper incorporates that value into query logic instead of treating it strictly as data through parameterized queries. This behavior maps to CWE-89, SQL Injection, because untrusted request input can influence the meaning of a database statement.

The underlying flaw is improper neutralization of special SQL elements in externally supplied input. The endpoint accepts a structured identifier value, and a downstream database helper incorporates that value into query logic instead of treating it strictly as data through parameterized queries. This behavior maps to CWE-89, SQL Injection, because untrusted request input can influence the meaning of a database statement.

Potential impact

  • An attacker may read sensitive database contents
  • Database queries could be delayed or abused to affect availability
  • WordPress users, configuration data, or plugin data could be exposed
  • Retrieved information could support further compromise of the site or connected services
  • An attacker may read sensitive database contents
  • Database queries could be delayed or abused to affect availability
  • WordPress users, configuration data, or plugin data could be exposed
  • Retrieved information could support further compromise of the site or connected services

General mitigation guidance

Mitigation generally centers on removing string-built SQL from request

handling paths and reducing trust in client-supplied identifiers.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for all database operations
  • Validate identifiers against strict type, format, and range rules before query construction
  • Reject unexpected array or nested parameter forms when scalar values are required
  • Apply allowlist-based request schemas and consistent server-side validation
  • Ensure database accounts use the minimum permissions required by the plugin
  • Avoid exposing unnecessary records through public API endpoints
  • Add regression tests for malformed, structured, and unexpected input types

Mitigation generally centers on removing string-built SQL from request

handling paths and reducing trust in client-supplied identifiers.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for all database operations
  • Validate identifiers against strict type, format, and range rules before query construction
  • Reject unexpected array or nested parameter forms when scalar values are required
  • Apply allowlist-based request schemas and consistent server-side validation
  • Ensure database accounts use the minimum permissions required by the plugin
  • Avoid exposing unnecessary records through public API endpoints
  • Add regression tests for malformed, structured, and unexpected input types

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings involving SQL strings assembled from request parameters
  • Database helper calls that receive values derived from REST route or query arguments
  • Code-review signals such as missing prepared statements, weak type checks, or implicit array-to-string handling
  • Web-application logs showing repeated malformed identifier parameters or unusual response timing
  • API policy checks that require schema validation and parameterized database access

Automated application-security testing and code-review tools may help identify

unsafe query construction and insufficient input validation.

Organizations can look for:

  • Static-analysis findings involving SQL strings assembled from request parameters
  • Database helper calls that receive values derived from REST route or query arguments
  • Code-review signals such as missing prepared statements, weak type checks, or implicit array-to-string handling
  • Web-application logs showing repeated malformed identifier parameters or unusual response timing
  • API policy checks that require schema validation and parameterized database access

Automated application-security testing and code-review tools may help identify

unsafe query construction and insufficient input validation.

Sources

SourceLink
github.comgithub.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/wordpress/notificationx-sqli.yaml
wordpress.orgwordpress.org/plugins/notificationx/
wpscan.comwpscan.com/vulnerability/d1480717-726d-4be2-95cb-1007a3f010bb
vulncheck.comvulncheck.com/advisories/notificationx-wordpress-plugin-2.3.12-unauthenticated-sql-injection-via-notification-rest-endpoint

Frequently asked

questions

Yes. It may be exploitable over the network when the affected WordPress REST

endpoint is publicly reachable. An authenticated WordPress session is not

generally required.

The attacker needs network access to the endpoint and the ability to submit

request parameters. The key enabling condition is that attacker-controlled

input reaches database query construction without sufficient safeguards.

Use parameterized database queries together with strict server-side validation

and rejection of unexpected parameter structures. Do not rely on client-side

formatting or superficial filtering.

Enforce secure database-access patterns through code review, static analysis,

API schemas, least-privilege database accounts, and regression tests covering

malformed and structured input.

Yes. It may be exploitable over the network when the affected WordPress REST

endpoint is publicly reachable. An authenticated WordPress session is not

generally required.

The attacker needs network access to the endpoint and the ability to submit

request parameters. The key enabling condition is that attacker-controlled

input reaches database query construction without sufficient safeguards.

Use parameterized database queries together with strict server-side validation

and rejection of unexpected parameter structures. Do not rely on client-side

formatting or superficial filtering.

Enforce secure database-access patterns through code review, static analysis,

API schemas, least-privilege database accounts, and regression tests covering

malformed and structured input.

Find out what's already
exploitable in your codebase.