1. Vulnerability Background
What is this vulnerability?
- CVE-2025-13419 is an authorization bypass in the WP Front User Submit / WP Front Editor plugin for WordPress.
- The REST API endpoint
POST /wp-json/bfe/v1/revertaccepted an attachment ID and deleted the corresponding media attachment with no capability check. - This is a broken object-level authorization / insecure direct object reference issue.
Why is it critical/important?
- The endpoint is destructive: it calls
wp_delete_attachment(..., true)and permanently removes media attachments. - An unauthenticated attacker can delete arbitrary attachments if they can guess or enumerate attachment IDs.
- Media deletions can disrupt site content, break pages, remove images and documents used by the site, and may be used as part of a broader attack.
What systems/versions are affected?
- WordPress sites running the WP Front User Submit / Front Editor plugin up to and including version 5.0.0.
- Any installation exposing the REST API and using this plugin is vulnerable.
2. Technical Details
Root cause analysis
- In
inc/fields/FileField.php, the oldrevert_file()handler read an attachment ID from the request body and immediately calledwp_delete_attachment(). - There was no authorization or ownership check.
- The endpoint did not differentiate between authenticated users, unauthenticated users, or whether the target attachment belonged to the requester.
Attack vector and exploitation conditions
- Attacker sends an HTTP request to
/wp-json/bfe/v1/revert. - The request body contains the numeric attachment ID.
- No authentication token, nonce, or capability check is required.
- If the attachment exists, the plugin deletes it.
Security implications
- Arbitrary media deletion: attackers can remove any attachment on the site.
- Data integrity and availability impact: pages, posts, and front-end content relying on deleted media may break.
- The issue is not limited to guest uploads; it affects any attachment ID accessible to the site.
3. Patch Analysis
What code changes were made?
- Added session initialization with
self::start_session_if_needed(). - Added input validation: if attachment ID is empty, return
WP_Error('invalid_id', ..., status => 400). - Added authorization checks:
- For logged-in users, require
current_user_can('delete_post', $attachment_id). - For guests, require the attachment ID be in
$_SESSION['bfe_uploaded_files'].
- For logged-in users, require
- Added a 403 response when the requester is not authorized.
- After deleting a guest-uploaded attachment, remove it from the session tracking array.
How do these changes fix the vulnerability?
- They prevent unauthenticated deletion of arbitrary attachments by enforcing authorization.
- Logged-in users can only delete attachments they are permitted to delete.
- Guest users can only delete attachments they uploaded during their session.
- Invalid or unauthorized requests now fail with appropriate REST errors instead of deleting attachments silently.
Security improvements introduced
- Explicit capability check for deletion operations.
- Ownership validation for guest uploads via session tracking.
- REST API error handling with proper HTTP status codes.
- Cleanup of session state after successful guest attachment deletion.
4. Proof of Concept (PoC) Guide
Prerequisites for exploitation
- A WordPress site with the vulnerable plugin version <= 5.0.0 installed.
- Knowledge or guess of a valid attachment ID present in the media library.
- Ability to send an HTTP POST request to the REST endpoint.
Step-by-step exploitation approach
- Identify a target attachment ID, e.g.
123. - Send a POST request to the endpoint:
- URL:
https://target.example.com/wp-json/bfe/v1/revert - Body:
123 - Content-Type:
text/plainor similar
- URL:
- Observe the response.
- Verify the attachment is removed from the WordPress media library.
Expected behavior vs exploited behavior
- Expected behavior after patch: request fails with 403 Forbidden for unauthorized users, or 400 Bad Request for invalid IDs.
- Exploited behavior on vulnerable versions: request succeeds and deletes the attachment regardless of authentication.
How to verify the vulnerability exists
- Before sending the exploit, note the presence of a known attachment in the media library.
- Send the unauthenticated POST request to
/wp-json/bfe/v1/revertwith that attachment ID. - If the attachment disappears and the endpoint does not require login, the vulnerability exists.
- A patched site should return an error and leave the attachment intact.
5. Recommendations
Mitigation strategies
- Update the plugin to a patched version that includes this fix.
- If patching is not immediately possible, disable or block access to
wp-json/bfe/v1/revertat the web server or WAF level. - Restrict access to the REST API where possible.
Detection methods
- Monitor logs for POST requests to
/wp-json/bfe/v1/revert. - Alert on unauthenticated access attempts to plugin-specific REST endpoints.
- Detect unexpected deletions in the media library and correlate with REST API activity.
Best practices to prevent similar issues
- Enforce capability and object-level authorization on all REST API endpoints, especially destructive ones.
- Validate ownership or session-based ownership for guest-uploaded resources.
- Return explicit REST error responses when authorization fails.
- Avoid designing unauthenticated endpoints that perform deletion or modification of site resources.