/

CVE-2025-14675

Severity:

HIGH RISK

(7.2)

Path Traversal / Arbitrary File Deletion in Meta Box

CVE-2025-14675

Deferred

Vulnerability type

Category:

Path Traversal / Arbitrary File Deletion

CWE:

CWE-22

Impact:

Arbitrary File Deletion Leading to Potential Remote Code Execution

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The Meta Box plugin for WordPress contains an arbitrary file deletion vulnerability where insufficient file path validation in the ajax_delete_file function allows deletion of files outside the intended upload directory.

Authenticated users with at least Contributor-level access can exploit this to delete critical application files on the server, which can in turn lead to full site compromise and potential remote code execution when sensitive configuration or executable files are removed.

Affected context

This vulnerability affects WordPress sites that:

  • Have the Meta Box plugin installed and activated in versions up to and including 5.11.1
  • Allow users with Contributor-level or higher roles to access Meta Box functionality that triggers the ajax_delete_file endpoint
  • Run on servers where the web process user has permission to delete files in WordPress core, plugin, theme, or configuration directories

The risk increases significantly when the PHP process can delete critical files like wp-config.php, .htaccess, or plugin/theme PHP files.

Exploit preconditions

  • Attack surface: Authenticated web interface (WordPress admin / AJAX endpoints exposed by Meta Box)
  • Required access: Valid WordPress account with Contributor-level or higher privileges
  • Trigger point: Invocation of the ajax_delete_file functionality with a crafted file path parameter
  • Why exploitation is possible: The server-side logic does not sufficiently constrain, normalize, or validate the target file path, allowing users to influence which file is deleted beyond the intended upload directory boundaries.

Why this happens

The core issue arises from inadequate validation of user-controlled file paths during a deletion operation, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Instead of strictly mapping the requested deletion to a whitelisted or server-generated file identifier, the code relies on a path parameter that can reference arbitrary locations on the filesystem.

Without strong checks such as canonicalization, directory whitelisting, or mapping to stored references, the deletion logic operates on attacker-influenced paths, allowing removal of files outside the allowed storage area.

Potential impact

  • Deletion of critical configuration files such as wp-config.php, potentially enabling reinstallation or takeover of the site
  • Deletion of .htaccess or other web server control files, weakening security controls or disrupting routing
  • Removal of plugin or theme PHP files, which can break functionality and may be combined with other weaknesses to achieve code execution
  • Denial of service by deleting core WordPress files, preventing the site from functioning
  • Facilitation of broader compromise when combined with other vulnerabilities or misconfigurations (e.g., reinstallation wizards, backup exposure)

General mitigation guidance

Effective mitigation focuses on strictly constraining file delete operations and removing direct trust in user-supplied paths:

  • Restrict deletion to files that are referenced by internal identifiers (e.g., attachment IDs or database records) rather than raw paths.
  • Normalize and canonicalize file paths, and enforce that the resolved path resides inside a pre-defined, application-controlled directory (e.g., the uploads folder).
  • Maintain a server-side mapping of allowed files and validate requests against this list instead of accepting arbitrary file names or paths from clients.
  • Apply least-privilege to the web server user so that it has only the minimal filesystem permissions necessary for uploads, reducing the blast radius of deletion bugs.
  • Where possible, design features to mark files as "deleted" in metadata rather than physically removing them immediately, limiting direct filesystem operations.

How teams detect issues like this

Organizations can detect this class of issue through a combination of code-level and runtime strategies:

  • Static analysis: Flag code patterns where user input flows into filesystem APIs (e.g., unlink, rm, or wrapper functions) without clear path normalization and directory checks.
  • Code review: Pay special attention to AJAX handlers and upload/delete endpoints, verifying that they operate on server-generated IDs and apply strict whitelisting of directories.
  • Policy enforcement: Define internal guidelines that prohibit direct use of user-controlled paths for file operations; enforce these via linters or custom SAST rules.
  • Runtime monitoring: Use file integrity monitoring to watch for unexpected deletions of configuration, core, or plugin files, especially originating from web server processes.

Sources

SourceLink
github.comgithub.com/wpmetabox/meta-box/pull/1654
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/meta-box/tags/5.11.0/inc/fields/file.php#L30
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/meta-box/tags/5.11.0/inc/fields/file.php#L54
plugins.trac.wordpress.orgplugins.trac.wordpress.org/changeset/3475210/meta-box#file3
wordfence.comwordfence.com/threat-intel/vulnerabilities/id/036467de-95bb-4bfd-9522-df8dc17f3102?source=cve

Frequently asked

questions

Exploitation is limited to authenticated users with at least Contributor-level privileges, but on many multi-user WordPress sites, such access is common enough that the risk remains significant, especially if contributors are untrusted or accounts can be phished.

The attacker needs valid WordPress credentials with Contributor or higher privileges and the ability to reach the Meta Box AJAX endpoint; no direct server or shell access is required.

Replace direct path-based deletion with an ID-based deletion model where the server resolves IDs to files in a strictly controlled directory, and verify via canonical path checks that the target file is within that directory before performing any filesystem operation.

Adopt secure file-handling patterns: never trust client-supplied paths, centralize file operations in a hardened utility that enforces directory whitelisting and canonicalization, and include automated checks (SAST, code review checklists) that highlight any use of user input in filesystem APIs.

Find out what's already
exploitable in your codebase.