Skip to content
Path traversal Write-up Intermediate

CVE-2023–6972 Wordpress Backup Migration ≤1.3.9 Arbitrary Fil

The Backup Migration plugin for WordPress (versions up to 1.3.9) trusts attacker-controlled HTTP headers to build file paths, allowing path traversal that reaches an unlink call. An attacker can delete arbitrary files such as wp-config.php, which can be chained to reinstall WordPress with a controlled database and then achieve remote code execution.

phantom_hat Follow

Published on medium.com

The Case Study focuses on CVE-2023–6972, which is Discovered by Hiroho Shimada.The Vulnerability Exploits the Wordpress Backup Migration Plugin ≤ 1.3.9. The CVSS score is 9.8, The Vulnerability is based on Arbitrary File Deletion (AFD)which can be Chained to RCE by deleting wp-config.php if it has enough permissions.

phantom_hat, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The plugin passes user-controlled HTTP header values directly into file path constants and class properties without adequate validation, so path traversal sequences reach an unlink sink.

Impact

An attacker could delete arbitrary files such as wp-config.php, and by chaining this with a reinstall using a controlled database they could gain admin access and then remote code execution.

What the attacker needed

Backup Migration plugin ≤ 1.3.9 installed; Network access to the plugin endpoint; No authentication required

The fix

The patch in version 1.4.0 added strict header validation with realpath() and a whitelist check, and replaced raw unlink with a wrapper that refuses to delete wp-config.php.

How it was found

  1. Send a request to the backup-heart.php endpoint with crafted headers including Content-Abs, Content-Dir, Content-Bmitmp, Content-Identy, Content-Backups, Content-Name, Content-It and Content-Dbit.
  2. Set Content-It to 0 and Content-Dbit to -1 so execution reaches make_file_groups().
  3. Ensure the file list check fails so send_error() is called.
  4. send_error() calls remove_commons() and then unlinks the backup path, deleting the targeted file.
  5. Delete wp-config.php and refresh the site to trigger the WordPress installation wizard.
  6. Provide a controlled database, complete installation, create an admin user, and upload a malicious plugin to obtain a reverse shell.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The plugin reads special HTTP headers sent by the browser and uses their values to decide which files to delete. Because it does not check those values properly, an attacker can make it delete important files like the WordPress configuration file. Once that file is gone, the site can be reinstalled by the attacker, who then gains full control.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by phantom_hat

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.