SurveyJS: Drag & Drop WordPress Form Builder <= 2.5.2 - Cross-Site Request Forgery to Survey Creation
Description
The SurveyJS: Drag & Drop WordPress Form Builder plugin for WordPress is vulnerable to Cross-Site Request Forgery in all versions up to, and including, 2.5.2. This is due to missing nonce validation on the SurveyJS_AddSurvey AJAX action. This makes it possible for unauthenticated attackers to create surveys via a forged request granted they can trick a site administrator into performing an action such as clicking on a link.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:NTechnical Details
<=2.5.2Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2025-13139 (SurveyJS CSRF) ## 1. Vulnerability Summary The **SurveyJS: Drag & Drop WordPress Form Builder** plugin (<= 2.5.2) is vulnerable to **Cross-Site Request Forgery (CSRF)** via the `SurveyJS_AddSurvey` AJAX action. The vulnerability exists because the plugi…
Show full research plan
Exploitation Research Plan: CVE-2025-13139 (SurveyJS CSRF)
1. Vulnerability Summary
The SurveyJS: Drag & Drop WordPress Form Builder plugin (<= 2.5.2) is vulnerable to Cross-Site Request Forgery (CSRF) via the SurveyJS_AddSurvey AJAX action. The vulnerability exists because the plugin fails to implement nonce validation (e.g., check_ajax_referer or wp_verify_nonce) in the handler function associated with this action. An unauthenticated attacker can create new surveys by tricking a logged-in administrator into submitting a forged request.
2. Attack Vector Analysis
- AJAX Action:
SurveyJS_AddSurvey(inferred from CVE description). - Endpoint:
/wp-admin/admin-ajax.php - HTTP Method:
POST - Authentication Requirement: The request must be executed in the context of an authenticated administrator (via CSRF).
- Vulnerable Parameter: The
actionparameter must beSurveyJS_AddSurvey. Other parameters likely includename(the survey title) andjson(the survey configuration). - Preconditions: The plugin must be active, and an administrator must be logged in.
3. Code Flow (Inferred)
- Registration: The plugin registers the AJAX hook during initialization (likely in
initoradmin_init):add_action('wp_ajax_SurveyJS_AddSurvey', 'SurveyJS_AddSurvey_handler'); - Trigger: An administrator visits a malicious page that auto-submits a POST request to
admin-ajax.phpwithaction=SurveyJS_AddSurvey. - Vulnerable Handler: The handler function (e.g.,
SurveyJS_AddSurvey_handler) processes the request. - Missing Check: The handler fails to call
check_ajax_referer('...', '...'). - Sink: The handler takes input from
$_POST['name']and$_POST['json']and inserts it directly into the database (likely the{prefix}surveyjs_surveystable) using$wpdb->insert().
4. Nonce Acquisition Strategy
No nonce is required.
The essence of this CSRF vulnerability is the total absence of nonce validation for the SurveyJS_AddSurvey action. Unlike vulnerabilities where a nonce is present but leaky, this specific CVE identifies a missing check. Therefore, the exploit request can be constructed without any _wpnonce or security parameter.
5. Exploitation Strategy
The goal is to demonstrate that an unauthenticated attacker can force an administrator's browser to create a survey.
- Identify Parameters: Confirm the exact names for the survey title and JSON data. Based on standard SurveyJS integrations, these are usually
nameandjson. - Craft Payload:
action:SurveyJS_AddSurveyname:CSRF_Exploit_Surveyjson:{"pages":[{"name":"page1","elements":[{"type":"text","name":"question1"}]}]}
- Simulate CSRF: Using the
http_requesttool, send a POST request to the target site using the administrator's cookies.
HTTP Request (as Admin)
POST /wp-admin/admin-ajax.php HTTP/1.1
Host: localhost:8080
Content-Type: application/x-www-form-urlencoded
Cookie: [Admin Cookies]
action=SurveyJS_AddSurvey&name=Exploit_Survey_Title&json=%7B%22title%22%3A%22Hacked%22%7D
6. Test Data Setup
- Install and activate SurveyJS: Drag & Drop WordPress Form Builder version 2.5.2.
- Create an administrator user.
- Obtain the administrator's session cookies (using
browser_navigateandbrowser_evalor by inspecting the environment if provided). - Verify the database table exists:
wp_surveyjs_surveys.
7. Expected Results
- The
admin-ajax.phpendpoint should return a200 OKstatus. - The response body should ideally be a JSON string like
{"success":true}or an ID of the newly created survey. - A new entry should appear in the WordPress database containing the name
Exploit_Survey_Title.
8. Verification Steps
After sending the http_request, use wp-cli to verify the state of the database:
# List all surveys in the SurveyJS table
wp db query "SELECT id, name FROM $(wp db prefix)surveyjs_surveys WHERE name = 'Exploit_Survey_Title';"
If the query returns a row, the CSRF exploit was successful.
9. Alternative Approaches
If SurveyJS_AddSurvey is not the correct action name (though stated in the CVE), search the plugin directory for other potential AJAX actions:
grep -r "wp_ajax_" wp-content/plugins/surveyjs/
Check for actions related to "Save", "Add", or "Create". If the primary exploit fails, check if the plugin uses a REST API endpoint instead of admin-ajax.php, though the CVE specifically mentions the AJAX action.
If name and json are not the parameter names, inspect the plugin's JavaScript files (e.g., admin.js or editor.js) to see how it sends data to the server:
grep -r "SurveyJS_AddSurvey" wp-content/plugins/surveyjs/ | grep ".js"
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.