CVE-2026-124211 in Ninja Tables Plugininfo

Summary

by MITRE • 11/26/2026

The Ninja Tables – Responsive Table Builder for Data, Pricing & Product Tables plugin for WordPress is vulnerable to SQL Injection via the 'dateFormat' column metadata parameter in versions up to, and including, 5.5.1 This is due to insufficient escaping on the stored 'dateFormat' value in DefaultProvider::orderByJsonQuery(); convertDateFormatToMysql() only performs str_replace on date-format tokens and leaves SQL metacharacters (including single quotes) intact, after which the value is concatenated directly into an orderByRaw() ORDER BY clause inside single quotes. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database; the payload is stored in the _ninja_table_columns post meta and executed on every unauthenticated request to the wp_ajax_ninja_tables_public_action AJAX endpoint when the table uses sorting_type='by_column' with a date column.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/26/2026

The Ninja Tables plugin for WordPress, specifically versions up to 5.5.1, contains a critical SQL injection vulnerability that stems from insufficient input validation and sanitization within its data handling mechanisms. This flaw is located in the DefaultProvider class, particularly affecting the orderByJsonQuery method which processes column metadata parameters. The core issue arises when the plugin attempts to convert date format tokens into MySQL-compatible syntax using the convertDateFormatToMysql function. Instead of employing robust parameterized queries or rigorous escaping techniques that neutralize special characters, this function relies solely on simple string replacement operations for date-format tokens. Consequently, SQL metacharacters such as single quotes remain intact within the processed value, creating a direct pathway for malicious input to alter database query structures.

The operational impact of this vulnerability is severe because it allows unauthenticated attackers to inject arbitrary SQL commands into existing queries without requiring any form of authentication or user privileges. The attack vector involves storing a crafted payload in the _ninja_table_columns post meta field, which serves as persistent storage for table configuration data within the WordPress database environment. Once stored, this malicious input is executed every time an unauthenticated request is made to the wp_ajax_ninja_tables_public_action AJAX endpoint under specific conditions: when the targeted table utilizes a sorting type of by_column and includes at least one date column in its display settings. This persistence mechanism ensures that the vulnerability can be triggered repeatedly without further interaction from the attacker, significantly increasing the risk surface for exploitation across any public-facing instance running the affected plugin version.

From a technical perspective, this flaw represents a classic case of stored SQL injection where user-controllable data is saved to the database and later rendered into an executable query context without proper sanitization. The concatenation of the unsanitized dateFormat value directly into an orderByRaw ORDER BY clause enclosed in single quotes provides attackers with precise control over the resulting SQL statement structure. By appending additional queries, adversaries can extract sensitive information such as administrative credentials, user data, or other confidential records stored within the WordPress database. This capability undermines the fundamental security principle of separation between code and data, allowing external input to dictate logical execution paths within the backend system.

This vulnerability aligns with Common Weakness Enumeration identifier CWE-89, which describes Improper Neutralization of Special Elements used in an SQL Command. The exploitation technique corresponds to ATT&CK tactic T1059, specifically sub-technique T1059.004 for command and scripting interpretation via database commands, although the primary impact here is data exfiltration rather than direct system execution. Organizations relying on this plugin must recognize that even unauthenticated endpoints handling display logic can serve as entry points for significant data breaches if input validation is not strictly enforced at all stages of processing.

To mitigate this risk, immediate action should be taken to update the Ninja Tables plugin to a version later than 5.5.1 where these sanitization issues have been addressed by the developers. In addition to updating, administrators should audit existing table configurations for any suspicious entries in the _ninja_table_columns meta data that may indicate prior exploitation attempts. Implementing Web Application Firewalls with rules capable of detecting SQL injection patterns can provide an additional layer of defense against such attacks while updates are being deployed. Furthermore, developers must ensure that all dynamic values inserted into database queries utilize prepared statements or rigorous escaping functions provided by the WordPress database API to prevent similar vulnerabilities in future releases and other plugins within the ecosystem.

Responsible

Wordfence

Reservation

11/06/2026

Disclosure

11/26/2026

Moderation

accepted

CPE

ready

EPSS

0.00567

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!