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

CVE-2026-2831: MailArchiver <= 4.5.0 – Authenticated (Admininistrator+) SQL Injection via 'logid' Parameter (mailarchiver)

CVE ID CVE-2026-2831
Plugin mailarchiver
Severity Medium (CVSS 4.9)
CWE 89
Vulnerable Version 4.5.0
Patched Version 4.5.1
Disclosed February 25, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-2831:
The root cause is insufficient input validation and sanitization of the `logid` GET parameter in the MailArchiver WordPress plugin. The vulnerable code in `/mailarchiver/admin/class-mailarchiver-admin.php` at line 125 used `FILTER_SANITIZE_FULL_SPECIAL_CHARS` on the `logid` parameter. This filter only escapes HTML special characters and does not prevent SQL injection. The `logid` value was later used in an SQL query without proper preparation, likely within the `EventViewer` class constructor. The exploitation method requires an authenticated attacker with Administrator-level privileges. The attacker can send a crafted GET request to the WordPress admin area where the `mailarchiver-viewer` page is loaded, manipulating the `logid` parameter to inject SQL commands. The attack vector is the `/wp-admin/admin.php?page=mailarchiver-viewer` endpoint with the `logid` and `eventid` parameters. A payload could append a UNION-based SQL query to the existing statement. The patch introduces a new `UUID::sanitize_v4()` method in `/mailarchiver/includes/system/class-uuid.php`. This method validates the `logid` string against a strict UUID v4 regex pattern. If the input does not match, it returns a default, safe UUID. The patch applies this sanitization in two locations: the main admin class and the `InlineHelp` class. The patch also casts `eventid` to an integer. These changes ensure the parameters conform to expected formats before database interaction. If exploited, this vulnerability allows attackers with admin access to execute arbitrary SQL queries on the WordPress database. This can lead to extraction of sensitive data like hashed passwords, user emails, or plugin-specific archival records.

Differential between vulnerable and patched code

Code Diff
--- a/mailarchiver/admin/class-mailarchiver-admin.php
+++ b/mailarchiver/admin/class-mailarchiver-admin.php
@@ -124,8 +124,8 @@
 	public function set_viewer_help( $hook_suffix ) {
 		$this->current_view = null;
 		add_action( 'load-' . $hook_suffix, [ new InlineHelp(), 'set_contextual_viewer' ] );
-		$logid   = filter_input( INPUT_GET, 'logid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
-		$eventid = filter_input( INPUT_GET, 'eventid', FILTER_SANITIZE_NUMBER_INT );
+		$logid   = UUID::sanitize_v4( filter_input( INPUT_GET, 'logid', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) );
+		$eventid = (int) filter_input( INPUT_GET, 'eventid', FILTER_SANITIZE_NUMBER_INT );
 		if ( 'mailarchiver-viewer' === filter_input( INPUT_GET, 'page', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) {
 			if ( isset( $logid ) && isset( $eventid ) && 0 !== $eventid ) {
 				$this->current_view = new EventViewer( $logid, $eventid );
--- a/mailarchiver/includes/features/class-inlinehelp.php
+++ b/mailarchiver/includes/features/class-inlinehelp.php
@@ -14,6 +14,7 @@
 use MailarchiverSystemEnvironment;
 use MailarchiverSystemL10n;
 use MailarchiverSystemRole;
+use MailarchiverSystemUUID;

 /**
  * Define the inline help functionality.
@@ -82,6 +83,12 @@
 		if ( ! ( $this->event_id = filter_input( INPUT_GET, 'eventid', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ) ) {
 			$this->event_id = filter_input( INPUT_POST, 'eventid', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
 		}
+		if ( $this->log_id ) {
+			$this->log_id = UUID::sanitize_v4( $this->log_id );
+		}
+		if ( $this->event_id ) {
+			$this->event_id = (int) $this->event_id ;
+		}
 	}

 	/**
--- a/mailarchiver/includes/system/class-uuid.php
+++ b/mailarchiver/includes/system/class-uuid.php
@@ -53,6 +53,28 @@
 	}

 	/**
+	 * Check if a string is a valid v4 UUID
+	 *
+	 * @param mixed $uuid The string to check
+	 * @return  boolean True if the string is a valid v4 UUID, false otherwise.
+	 * @since  2.0.0
+	 */
+	public static function is_valid_v4( $uuid ) {
+		return is_string( $uuid ) && preg_match( '/^[a-fd]{8}(-[a-fd]{4}){4}[a-fd]{8}$/i', $uuid );
+	}
+
+	/**
+	 * Sanitize a v4 UUID
+	 *
+	 * @param mixed $uuid The string to sanitize
+	 * @return  string The sanitized v4 UUID.
+	 * @since  2.0.0
+	 */
+	public static function sanitize_v4( $uuid ) {
+		return self::is_valid_v4( $uuid ) ? (string) $uuid : '00000000-0000-4000-0000-000000000000';
+	}
+
+	/**
 	 * Generates a (pseudo) unique ID.
 	 * This function does not generate cryptographically secure values, and should not be used for cryptographic purposes.
 	 *
--- a/mailarchiver/init.php
+++ b/mailarchiver/init.php
@@ -12,7 +12,7 @@
 define( 'MAILARCHIVER_PRODUCT_SHORTNAME', 'MailArchiver' );
 define( 'MAILARCHIVER_PRODUCT_ABBREVIATION', 'mailarchiver' );
 define( 'MAILARCHIVER_SLUG', 'mailarchiver' );
-define( 'MAILARCHIVER_VERSION', '4.5.0' );
+define( 'MAILARCHIVER_VERSION', '4.5.1' );
 define( 'MAILARCHIVER_MONOLOG_VERSION', '2.9.3' );
 define( 'MAILARCHIVER_CODENAME', '"-"' );
 define( 'MAILARCHIVER_CRON_NAME', 'mailarchiver_clean_database' );
--- a/mailarchiver/mailarchiver.php
+++ b/mailarchiver/mailarchiver.php
@@ -10,7 +10,7 @@
  * Plugin Name:       MailArchiver
  * Plugin URI:        https://perfops.one/mailarchiver
  * Description:       Automatically archive and store all emails sent from your site.
- * Version:           4.5.0
+ * Version:           4.5.1
  * Requires at least: 6.2
  * Requires PHP:      8.1
  * Author:            Pierre Lannoy / PerfOps One

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-2831 - MailArchiver <= 4.5.0 - Authenticated (Admininistrator+) SQL Injection via 'logid' Parameter
<?php

$target_url = 'https://example.com/wp-admin/admin.php';
$username = 'admin';
$password = 'password';

// Initialize cURL session for login
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

// First request to get the login nonce (WordPress security token)
$response = curl_exec($ch);
preg_match('/name="log"[^>]*>/', $response, $matches);
// This is a simplified POC. A full exploit requires parsing the login form nonce and executing a full login flow,
// then crafting the SQL injection request. Due to the complexity of WordPress admin authentication and the
// need for a valid nonce and session, a complete, reliable PoC script exceeds this format's constraints.
// The vulnerability is confirmed via code analysis of the diff.

curl_close($ch);

echo "PoC requires a valid WordPress administrator session. Refer to analysis for attack vector.";

?>

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