/

CVE-2026-13492

Severity:

HIGH RISK

(8.8)

Arbitrary File Deletion (CWE-22) in UsersWP Plugin

CVE-2026-13492

Deferred

Vulnerability type

Category:

Path Traversal / Arbitrary File Deletion

CWE:

CWE-22

Impact:

Arbitrary File Deletion on Server Filesystem

Severity:

HIGH RISK

(8.8)

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 UsersWP WordPress plugin contains an arbitrary file deletion flaw where attacker-controlled file metadata is used to build filesystem paths without proper validation or boundary checks.

Authenticated users with Subscriber-level access and above can abuse an AJAX handler to delete files outside the uploads directory, including critical configuration files such as wp-config.php, when the vulnerable conditions are present.

Affected context

This vulnerability occurs in WordPress sites that:

  • Have the UsersWP plugin installed at version 1.2.65 or earlier
  • Allow logged-in users (Subscriber and above) to submit or edit forms containing file-type fields
  • Rely on UsersWP_Validation::validate_fields() together with UsersWP_Forms::upload_file_remove() for handling file uploads and removals

In these contexts, untrusted metadata from file fields can propagate directly into filesystem operations targeting the server's uploads directory and beyond.

Exploit preconditions

  • Attack surface: Web application via UsersWP AJAX endpoints
  • Required access: Valid authenticated account with at least Subscriber-level privileges
  • Trigger point: Invocation of the upload_file_remove AJAX handler that constructs a deletion path from user-controlled file metadata
  • Why exploitation is possible: File-field values are only passed through sanitize_text_field(), which preserves directory traversal sequences; the resulting value is concatenated with the uploads base directory without realpath canonicalization or enforcement that the computed path stays inside the uploads directory before calling unlink().

Why this happens

The core issue is improper path validation when using user-supplied input to construct filesystem paths, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory (Path Traversal).

UsersWP's validation logic treats file-type fields as text, allowing traversal sequences like ../ to persist, and the subsequent AJAX handler directly concatenates this untrusted metadata with the uploads base directory.

Because there is no canonicalization, normalization, or strict check that the target path resides within an allowed directory, attackers can influence unlink() to operate on arbitrary files on the server.

Potential impact

  • Authenticated users may delete critical WordPress configuration files (e.g., wp-config.php), potentially breaking the site.
  • Attackers could remove .htaccess or similar protection files, weakening security controls.
  • Deletion of plugin or theme files could cause functionality loss, downtime, or inconsistent system behavior.
  • Removal of log files may hinder incident investigation and monitoring.
  • Targeted deletion of backup files could make recovery from other compromises more difficult.

General mitigation guidance

Effective mitigation focuses on constraining filesystem operations and treating all path fragments derived from user input as untrusted.

Common defensive patterns include:

  • Implementing strict allow-listing for directories and filenames, ensuring deletion targets are limited to known safe locations inside the uploads directory.
  • Canonicalizing paths using realpath or equivalent APIs and verifying that the resolved path starts with the expected uploads base directory before performing any file operation.
  • Separating user-visible identifiers (such as media IDs or tokens) from actual filesystem paths, storing the true paths server-side and never trusting client-supplied path segments.
  • Applying least-privilege to the web server user and filesystem, so even if validation fails, the impact of file deletion is constrained.
  • Designing file-handling components to be secure by default, making unsafe direct path manipulation or concatenation hard or impossible for developers to implement.

How teams detect issues like this

Organizations can detect similar path traversal and arbitrary file deletion risks through a combination of:

  • Static analysis rules that flag direct use of user-controlled input in filesystem APIs such as unlink, delete, rename, or file_put_contents.
  • Code review practices that look for path construction via simple string concatenation of input values with base directories, and verify that canonicalization and boundary checks are present.
  • Application-level logging of file deletion operations, including the requesting user, source endpoint, and full resolved path, then monitoring for deletions outside expected directories.
  • Security policy enforcement in CI/CD pipelines that require use of centralized, hardened file-management utilities rather than ad hoc path handling in plugin code.
  • Optional automated scanning tools that understand WordPress-specific patterns and can highlight risky AJAX handlers and form processing functions that manipulate files.

Sources

SourceLink
github.comgithub.com/AyeCode/userswp/commit/ddb17ad30ff3384cda85c5f372db30b03bd45ac8
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/userswp/tags/1.2.65/includes/class-forms.php#L1059
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/userswp/tags/1.2.65/includes/class-forms.php#L1973
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/userswp/tags/1.2.65/includes/class-forms.php#L2320
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/userswp/tags/1.2.65/includes/class-forms.php#L2323
plugins.trac.wordpress.orgplugins.trac.wordpress.org/browser/userswp/tags/1.2.65/includes/class-validation.php#L190
plugins.trac.wordpress.orgplugins.trac.wordpress.org/changeset/3590340/userswp
wordfence.comwordfence.com/threat-intel/vulnerabilities/id/b6cf6390-480f-44e2-ae36-67e3398add33?source=cve

Frequently asked

questions

Yes, it is accessible over the web but requires an authenticated WordPress account with at least Subscriber-level privileges; anonymous visitors cannot directly exploit it.

The attacker needs valid credentials for a user role allowed to interact with UsersWP forms and the associated AJAX handlers, typically Subscriber or higher.

The safest approach is to remove any direct use of user-supplied path fragments in filesystem operations, instead resolving file identifiers server-side, canonicalizing paths, and enforcing strict directory boundaries before performing deletions.

Establish secure file-handling abstractions that encapsulate path validation, require canonicalization and boundary checks, use least-privilege permissions, and subject any new file-related code to targeted security review and automated static analysis.

Find out what's already
exploitable in your codebase.