Skip to main content
Vulnerability Database/CVE-2022-51021

CVE-2022-51021: NotificationX WordPress Plugin SQLi Vulnerability

CVE-2022-51021 is an unauthenticated SQL injection flaw in NotificationX WordPress plugin versions 2.0.0 to 2.3.11 that enables attackers to manipulate database queries remotely. This article covers technical details, affected versions, exploitation methods, and recommended security measures.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2022-51021 Overview

CVE-2022-51021 is an unauthenticated SQL injection vulnerability in the NotificationX plugin for WordPress, affecting versions 2.0.0 through 2.3.11. The flaw lives in the REST endpoint /wp-json/notificationx/v1/notification/{id}, which accepts an array-form id parameter and passes attacker-controlled input to Database::get_where_query without sanitization. Remote attackers can issue crafted requests to manipulate backend database queries and extract sensitive content, including WordPress user records and credentials. The Shadowserver Foundation first reported in-the-wild exploitation attempts on 2023-10-18. The weakness is classified under CWE-89.

Critical Impact

Unauthenticated remote attackers can execute arbitrary SQL against the WordPress database, enabling exfiltration of credentials, session tokens, and site configuration data.

Affected Products

  • NotificationX plugin for WordPress, version 2.0.0
  • NotificationX plugin for WordPress, versions 2.0.x through 2.3.11
  • WordPress sites running NotificationX before fixed release 2.3.12

Discovery Timeline

  • 2023-10-18 - Exploitation attempts first observed by the Shadowserver Foundation
  • 2026-10-22 - CVE-2022-51021 published to the National Vulnerability Database (NVD)
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2022-51021

Vulnerability Analysis

The NotificationX plugin exposes a public REST route at /wp-json/notificationx/v1/notification/{id} that resolves notification records by identifier. The handler accepts the id parameter in array form, meaning id[1] can carry a secondary value that is forwarded into the backend query builder. The plugin trusts this value and concatenates it into a WHERE clause through Database::get_where_query without parameterization or type enforcement.

Because the endpoint does not require authentication, any remote client that can reach the WordPress site can issue the malformed request. Attackers typically probe the flaw with time-based payloads such as SLEEP(5) to confirm injection, then shift to UNION-based or boolean-based extraction to retrieve column contents. Successful exploitation yields direct read access to the wp_users, wp_usermeta, and wp_options tables.

Root Cause

The root cause is improper neutralization of special elements used in an SQL command [CWE-89]. The REST handler fails to validate that id is a scalar integer and does not use prepared statements when building the WHERE clause. Array traversal of the id parameter allows the second element to flow unsanitized through Database::get_where_query and into the final SQL string executed by $wpdb.

Attack Vector

Exploitation requires only network reachability to the WordPress REST API. The attacker sends a GET request to /wp-json/notificationx/v1/notification/{id} with the id parameter supplied as an array, placing the SQL payload in id[1]. The request also includes an api_key value computed as md5(home_url()), which is derivable by any visitor who can resolve the site's canonical URL. No user interaction, cookies, or privileges are required.

The vulnerability mechanism is documented in the public Nuclei detection template and the VulnCheck advisory. See the published advisories for payload specifics.

Detection Methods for CVE-2022-51021

Indicators of Compromise

  • HTTP requests to /wp-json/notificationx/v1/notification/ containing array-form parameters such as id[1]= in the query string or body
  • Request bodies or query strings containing SQL keywords like SLEEP(, UNION SELECT, BENCHMARK(, or SELECT CONCAT targeting the NotificationX REST route
  • Presence of an api_key value matching the MD5 of the site's home_url() on unauthenticated REST calls
  • Anomalous WordPress response latency correlating with time-based payloads sent to the NotificationX endpoint

Detection Strategies

  • Deploy the public Nuclei template for NotificationX SQLi against assets to identify vulnerable installations
  • Alert on WAF or reverse-proxy logs where the notificationx/v1/notification path contains bracketed array indices in the id parameter
  • Query database audit logs for unexpected SELECT statements originating from the WordPress service account against wp_users or wp_usermeta outside normal admin workflows

Monitoring Recommendations

  • Baseline normal traffic patterns for the NotificationX REST endpoint and alert on request volume spikes from single source addresses
  • Correlate web access logs with backend MySQL/MariaDB slow-query logs to identify time-based injection attempts
  • Enable WordPress plugin version inventory scanning to flag any NotificationX install below 2.3.12

How to Mitigate CVE-2022-51021

Immediate Actions Required

  • Upgrade the NotificationX plugin to version 2.3.12 or later through the WordPress plugin administration interface
  • If upgrading is not immediately feasible, deactivate and remove the NotificationX plugin until patching is complete
  • Rotate WordPress administrator passwords and secret keys defined in wp-config.php if the site was exposed before patching
  • Review the wp_users and wp_usermeta tables for unexpected accounts or modified password hashes

Patch Information

The vendor addressed the issue in NotificationX version 2.3.12. The fix enforces scalar validation on the id parameter and parameterizes the query built by Database::get_where_query. Patch details and remediation guidance are available via the WordPress NotificationX plugin page and the WPScan vulnerability entry.

Workarounds

  • Block external access to /wp-json/notificationx/v1/notification/ at the web application firewall or reverse proxy until the plugin is updated
  • Add a WAF rule that rejects REST requests containing bracketed array notation in the id parameter targeting the NotificationX route
  • Restrict the WordPress REST API to authenticated users where business logic allows, using plugins or server rules that enforce authentication on /wp-json/ endpoints
bash
# Example nginx rule to block the vulnerable request pattern
location ~ ^/wp-json/notificationx/v1/notification/ {
    if ($args ~* "id(%5B|\[)[0-9]+(%5D|\])") {
        return 403;
    }
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.