Opens in a new tab
Published : November 16, 2026

CVE-2026-119643: MembershipWorks <= 6.17 Unauthenticated Stored Cross-Site Scripting via Member Name and Event Fields PoC, Patch Analysis & Rule

Plugin memberfindme
Severity High (CVSS 7.2)
CWE 79
Vulnerable Version 6.17
Patched Version 6.18
Disclosed November 15, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-119643: This is an unauthenticated stored cross-site scripting (XSS) vulnerability in the MembershipWorks plugin for WordPress, affecting all versions up to and including 6.17. The flaw resides in the plugin’s output handling of data fetched from the MembershipWorks SaaS API, specifically within the sf_shortcode(), sf_widget_event_do(), and sf_widget_folder_do() functions. Member-supplied fields such as ‘nam’ (member name), ‘ttl’ (event title), ‘url’, ‘adn’ (venue name), ‘szp’, and ‘ezp’ are rendered into page HTML without proper escaping, enabling attackers to inject malicious scripts. The CVSS score of 7.2 reflects the high confidentiality, integrity, and availability impact typical of stored XSS in a widely deployed plugin.

Root Cause: The vulnerability stems from insufficient output escaping on API-derived data before it is inserted into HTML contexts. In sf_shortcode() (memberfindme.php, lines around 560-620), the ‘listlabel’ and ‘listevents’ branches output $usr[‘nam’], $usr[‘url’], $evt[‘ttl’], $evt[‘url’], $evt[‘szp’], and $evt[‘ezp’] directly without escaping. The sf_widget_event_do() function (lines 634-661) similarly outputs $x[‘ttl’], $x[‘szp’], $x[‘ezp’], and $x[‘adn’] unescaped. In sf_widget_folder_do() (lines 710-740), the member image alt attribute is populated with $x[‘nam’], and an onerror handler copies that alt text into innerHTML via this.parentNode.innerHTML=this.alt, creating a DOM-based XSS sink. These functions trust the API response data, which can be manipulated by malicious members or event organizers to include script payloads.

Exploitation: An unauthenticated attacker can exploit this by registering as a member or submitting an event with a malicious name, title, or venue. When a victim visits a page containing the vulnerable shortcode or widget (e.g., a directory listing, event list, or member showcase), the injected JavaScript executes in the victim’s browser. For example, an attacker could set their member name to alert(document.cookie) or an event title to . The sf_widget_folder_do() alt-attribute vector is particularly dangerous: an attacker with control over the member name or logo URL can inject a payload like x” onerror=”alert(1) into the image alt text, which is then copied into innerHTML by the existing onerror handler. No authentication is required, and the payload persists until the API data is updated.

Patch Analysis: The patch (version 6.18) addresses the issue by applying context-appropriate escaping and sanitization. In sf_shortcode(), listlabel and listevents outputs now use esc_url() for URLs and esc_html() or wp_kses_post() for text fields. The sf_widget_event_do() function uses esc_url(), wp_kses_post(), and esc_html() for title, start/end times, and venue. In sf_widget_folder_do(), the alt attribute is escaped with esc_attr(), and the onerror handler is changed from innerHTML to textContent, preventing DOM XSS. The patch also adds esc_attr() and esc_url() to meta tag outputs, escapes the document title, and introduces nonce-like checks for certain shortcode attributes. These changes ensure that any malicious HTML in API fields is neutralized before rendering.

Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of a victim’s session, leading to cookie theft, session hijacking, credential theft, or redirection to malicious sites. Since the vulnerability is unauthenticated and stored, it can affect any visitor to the compromised page, including administrators. This can result in full site compromise if an admin session is hijacked, enabling the attacker to create rogue admin accounts, install malicious plugins, or modify content. The confidentiality, integrity, and availability of the WordPress site are all at risk.

Differential between vulnerable and patched code

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

Code Diff
--- a/memberfindme/memberfindme.php
+++ b/memberfindme/memberfindme.php
@@ -3,7 +3,7 @@
 Plugin Name: MembershipWorks - Membership, Events & Directory
 Plugin URI: https://membershipworks.com
 Description: Membership Works plugin
-Version: 6.17
+Version: 6.18
 Author: MembershipWorks
 Author URI: https://membershipworks.com
 License: GPL2
@@ -25,6 +25,8 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

+defined('ABSPATH') || exit;
+
 $SF_widgetid=0;
 $SF_member_account=false;
 $SF_member_labels=array();
@@ -52,7 +54,7 @@
 	//	return array('error'=>'No response');
 	//else
 	//	return json_decode($rsp,true);
-	$args=array('headers'=>array('from'=>isset($_SERVER['HTTP_X_FORWARDED_FOR'])?$_SERVER['HTTP_X_FORWARDED_FOR']:$_SERVER['REMOTE_ADDR']),'user-agent'=>$_SERVER['HTTP_USER_AGENT']);
+	$args=array('headers'=>array('from'=>isset($_SERVER['HTTP_X_FORWARDED_FOR'])?$_SERVER['HTTP_X_FORWARDED_FOR']:($_SERVER['REMOTE_ADDR']??'')),'user-agent'=>$_SERVER['HTTP_USER_AGENT']??'');
 	for($try=0;$try<3;$try++) {
 		$rsp=wp_remote_get($con.'://api.membershipworks.com/'.$fn.'?'.implode('&',$q),$args);
 		if (is_wp_error($rsp)) usleep(100000); else break;
@@ -124,8 +126,8 @@
 		wp_die(__('You do not have sufficient permissions to access this page.'));
 	}
 	$raw=current_user_can('unfiltered_html');
-	$in['org']=intval($in['org']);
-	$in['org']=(is_int($in['org'])?strval($in['org']):'');
+	$org=isset($in['org'])?intval($in['org']):0;
+	$in['org']=$org>0?strval($org):'';
 	if (!empty($in['fbk'])) $in['fbk']=trim($in['fbk']); else unset($in['fbk']);
 	if (!empty($in['map'])) $in['map']=trim($in['map']); else unset($in['map']);
 	if (!empty($in['fnd'])) $in['fnd']=trim($in['fnd']); else unset($in['fnd']);
@@ -139,8 +141,8 @@
 	if (!empty($in['moe'])) $in['moe']=$raw?trim($in['moe']):wp_kses_post(trim($in['moe'])); else unset($in['moe']);
 	if (!empty($in['mon'])) $in['mon']=$raw?trim($in['mon']):wp_kses_post(trim($in['mon'])); else unset($in['mon']);
 	if (!empty($in['moi'])) $in['moi']=$raw?trim($in['moi']):wp_kses_post(trim($in['moi'])); else unset($in['moi']);
-	if (!empty($in['ssl'])) $in['ssl']=trim($in['ssl']); else unset($in['ssl']);
-	return $in; // preserve other fields for $in including wpl
+	if (!empty($in['ssl'])&&in_array($in['ssl'],['1','2'],true)) $in['ssl']=trim($in['ssl']); else unset($in['ssl']);
+	return $in;
 }

 function sf_admin_page() {
@@ -205,7 +207,7 @@
 	$arg=func_get_args();
 	if (empty($SF_page_data)||empty($SF_page_data['ttl']))
 		return empty($arg)?'':$arg[0];
-	return $SF_page_data['ttl'];
+	return esc_html($SF_page_data['ttl']);
 }

 function sf_mfm_init() {
@@ -216,7 +218,7 @@
 add_action('init','sf_mfm_init');

 function sf_mfm_wp() {
-	global $post,$SF_page_data,$SF_enqueue_css;
+	global $wp_query,$post,$SF_page_data,$SF_enqueue_css,$wpseo_front;
 	add_filter('document_title_parts','sf_document_title_parts',20,1);
 	if (empty($post)||!is_object($post)) return;
 	$arg=func_get_args();
@@ -229,26 +231,26 @@
 	}
 	if ($x!==false&&empty($settings['htm']))
 		$SF_enqueue_css=true;
-	if ($x!==false&&(isset($_GET['_escaped_fragment_'])||preg_match("/slurp|msnbot|facebook|meta/i",$_SERVER['HTTP_USER_AGENT'])>0)) {
+	if ($x!==false&&(isset($_GET['_escaped_fragment_'])||preg_match("/slurp|msnbot|facebook|meta/i",$_SERVER['HTTP_USER_AGENT']??'')>0)) {
 		$str=substr($post->post_content,$x+1,$y-$x-1);
 		$mat=array();
 		$opt=array();
 		if (preg_match_all('/s([a-z-]*)(=("|“|”|&[^;]*;)+.*?("|“|”|&[^;]*;))?/',$str,$mat,PREG_PATTERN_ORDER)&&!empty($mat)&&!empty($mat[1])) foreach($mat[1] as $key=>$val)
 			$opt[$val]=empty($mat[2][$key])?'':trim(preg_replace('/^=("|“|”|&[^;]*;)*|("|“|”|&[^;]*;)*$/','',$mat[2][$key]));
-		if (isset($_GET['_escaped_fragment_'])) {
+		if (isset($_GET['_escaped_fragment_'])&&is_string($_GET['_escaped_fragment_'])) {
 			$pne=$_GET['_escaped_fragment_'];
 			remove_action('wp_head','jetpack_og_tags');
 			add_filter('jetpack_enable_open_graph','__return_false',99);
 			add_filter('jetpack_disable_twitter_cards','__return_true',99);
 			if (defined('WPSEO_VERSION')) { // Yoast SEO
 				// add filters just in case
-				add_filter('wpseo_canonical',function($p){global $SF_page_data;return isset($SF_page_data['rel'])?$SF_page_data['rel']:$p;});
-				add_filter('wpseo_title',function($p){global $SF_page_data;return isset($SF_page_data['ttl'])?$SF_page_data['ttl']:$p;});
-				add_filter('wpseo_metadesc',function($p){global $SF_page_data;return isset($SF_page_data['sum'])?$SF_page_data['sum']:$p;});
-				add_filter('wpseo_opengraph_url',function($p){global $SF_page_data;return isset($SF_page_data['rel'])?$SF_page_data['rel']:$p;});
-				add_filter('wpseo_opengraph_title',function($p){global $SF_page_data;return isset($SF_page_data['ttl'])?$SF_page_data['ttl']:$p;});
-				add_filter('wpseo_opengraph_desc',function($p){global $SF_page_data;return isset($SF_page_data['sum'])?$SF_page_data['sum']:$p;});
-				add_filter('wpseo_opengraph_image',function($p){global $SF_page_data;return isset($SF_page_data['img'])?$SF_page_data['img']:$p;});
+				add_filter('wpseo_canonical',function($p){global $SF_page_data;return isset($SF_page_data['rel'])?esc_url($SF_page_data['rel']):$p;});
+				add_filter('wpseo_title',function($p){global $SF_page_data;return isset($SF_page_data['ttl'])?esc_html($SF_page_data['ttl']):$p;});
+				add_filter('wpseo_metadesc',function($p){global $SF_page_data;return isset($SF_page_data['sum'])?esc_html($SF_page_data['sum']):$p;});
+				add_filter('wpseo_opengraph_url',function($p){global $SF_page_data;return isset($SF_page_data['rel'])?esc_url($SF_page_data['rel']):$p;});
+				add_filter('wpseo_opengraph_title',function($p){global $SF_page_data;return isset($SF_page_data['ttl'])?esc_html($SF_page_data['ttl']):$p;});
+				add_filter('wpseo_opengraph_desc',function($p){global $SF_page_data;return isset($SF_page_data['sum'])?esc_html($SF_page_data['sum']):$p;});
+				add_filter('wpseo_opengraph_image',function($p){global $SF_page_data;return isset($SF_page_data['img'])?esc_url($SF_page_data['img']):$p;});
 				// remove wpseo from wp_head and wp_title
 				if (class_exists('YoastWPSEOIntegrationsFront_End_Integration')) {
 					global $wp_filter;
@@ -284,22 +286,27 @@
 			if (!empty($opt['lbl'])) $qry['lbl']=$opt['lbl']; else if (!empty($opt['labels'])) $qry['lbl']=$opt['labels'];
 			if (!empty($opt['folder'])) $qry['dek']=$opt['folder'];
 			if (isset($opt['evg'])) $qry['evg']=$opt['evg'];
-				$SF_page_data=sf_api('http','GET','api',$qry);
+				$SF_page_data=sf_api(empty($settings['ssl'])?'https':'http','GET','api',$qry);
 			if (empty($SF_page_data)||!empty($SF_page_data['error']))
 				$SF_page_data=false;
 			else
 				$SF_page_data['set']=$settings;
 		}
 	}
-	if (!empty($SF_page_data)||strpos($post->post_content,'[memberonly')!==false) {
+	$has_memberonly_content=false;
+	if (!empty($wp_query->posts)) foreach($wp_query->posts as $p) if (is_object($p)&&strpos($p->post_content,'[memberonly')!==false) {
+		$has_memberonly_content=true;
+		break;
+	}
+	if (!empty($SF_page_data)||$has_memberonly_content) {
 		if (!defined('DONOTCACHEPAGE')) define('DONOTCACHEPAGE',true);
 		if (!defined('DONOTCACHEOBJECT')) define('DONOTCACHEOBJECT',true);
 		if (!defined('DONOTCDN')) define('DONOTCDN',true);
-		if (function_exists('wp_using_ext_object_cache')) {
-			wp_using_ext_object_cache(false);
-			wp_cache_flush();
-			wp_cache_init();
-		}
+		//if (function_exists('wp_using_ext_object_cache')) {
+		//	wp_using_ext_object_cache(false);
+		//	wp_cache_flush();
+		//	wp_cache_init();
+		//}
 		nocache_headers();
 		setcookie('wordpress_donotcache',time());
 	}
@@ -309,7 +316,7 @@
 function sf_document_title_parts($title) {
 	global $SF_page_data;
 	if (!empty($SF_page_data)&&!empty($SF_page_data['ttl']))
-		$title['title']=$SF_page_data['ttl'];
+		$title['title']=esc_html($SF_page_data['ttl']);
 	return $title;
 }

@@ -318,26 +325,26 @@
 	if (!empty($SF_page_data)) {
 		$out=array();
 		if (isset($SF_page_data['sum']))
-			$out[]='<meta name="description" content="'.str_replace('"','"',$SF_page_data['sum']).'" />';
+			$out[]='<meta name="description" content="'.esc_attr($SF_page_data['sum']).'" />';
 		if (isset($SF_page_data['ttl'])) {
-			$out[]='<meta property="og:site_name" content="'.str_replace('"','"',get_bloginfo('name')).'" />';
-			$out[]='<meta property="og:title" content="'.str_replace('"','"',$SF_page_data['ttl']).'" />';
+			$out[]='<meta property="og:site_name" content="'.esc_attr(get_bloginfo('name')).'" />';
+			$out[]='<meta property="og:title" content="'.esc_attr($SF_page_data['ttl']).'" />';
 		}
 		if (isset($SF_page_data['img'])) {
-			$out[]='<meta property="og:image" content="'.$SF_page_data['img'].'" />';
-			$out[]='<meta property="og:image:secure_url" content="'.str_replace('http://','https://',$SF_page_data['img']).'" />';
+			$out[]='<meta property="og:image" content="'.esc_url($SF_page_data['img']).'" />';
+			$out[]='<meta property="og:image:secure_url" content="'.esc_url(str_replace('http://','https://',$SF_page_data['img'])).'" />';
 		}
 		if (isset($SF_page_data['sum'])) {
-			$out[]='<meta property="og:description" content="'.str_replace('"','"',$SF_page_data['sum']).'" />';
+			$out[]='<meta property="og:description" content="'.esc_attr($SF_page_data['sum']).'" />';
 		}
 		if (isset($_GET['_escaped_fragment_'])&&isset($SF_page_data['rel'])) {
-			$out[]='<meta property="og:url" content="'.$SF_page_data['rel'].'" />';
-			$out[]='<link rel="canonical" href="'.$SF_page_data['rel'].'" />';
+			$out[]='<meta property="og:url" content="'.esc_url($SF_page_data['rel']).'" />';
+			$out[]='<link rel="canonical" href="'.esc_url($SF_page_data['rel']).'" />';
 		}
 		if (isset($SF_page_data['nxt']))
-			$out[]='<link rel="next" href="'.$SF_page_data['nxt'].'" />';
+			$out[]='<link rel="next" href="'.esc_url($SF_page_data['nxt']).'" />';
 		if (isset($SF_page_data['prv']))
-			$out[]='<link rel="prev" href="'.$SF_page_data['prv'].'" />';
+			$out[]='<link rel="prev" href="'.esc_url($SF_page_data['prv']).'" />';
 		echo implode("rn",$out).(count($out)?"rn":'');
 	}
 }
@@ -354,8 +361,11 @@
 	for ($i=0;$i<strlen($content)&&($x=strpos($content,'[memberonly',$i))!==false;) {
 		$y=strpos($content,']',$x);
 		if (($x>0&&substr($content,$x-1,1)=='[')||$y===false) { $i=$x+1; continue; } // escaped shortcode or shortcode not closed
-		if (!defined('DONOTCACHEPAGE'))
+		if (!defined('DONOTCACHEPAGE')) {
 			define('DONOTCACHEPAGE',true);
+			if (!defined('DONOTCACHEOBJECT')) define('DONOTCACHEOBJECT',true);
+			if (!defined('DONOTCDN')) define('DONOTCDN',true);
+		}
 		if (($z=strpos($content,'[/memberonly]',$y))===false) { $z=strlen($content); $l=$z-$y-1; } else { $l=$z-$y-1; $z+=13; }
 		$str=substr($content,$x+1,$y-$x-1);
 		$mat=array();
@@ -418,6 +428,10 @@
 	return $content;
 }

+function sf_kses_post($dtl) {
+	return str_replace('class="SFcrdlgo"','class="SFcrdlgo" onload="this.className+=Math.sign(this.naturalWidth-2*this.naturalHeight)==-1?' SFcrdlgt':' SFcrdlgw'"',wp_kses_post($dtl));
+}
+
 function sf_shortcode($content) {
 	global $SF_member_account,$SF_member_labels,$SF_member_folders,$SF_page_data;
 	$settings=get_option('sf_set',array());
@@ -440,7 +454,7 @@
 		} else if (current_user_can('edit_post',get_the_ID())) {
 			$tmp=[];
 			foreach ($opt as $key=>$val) $tmp[]=$key.'="'.$val.'"';
-			$out='[administrator notice: content below memberonly '.implode(' ',$tmp).']'
+			$out='[administrator notice: content below memberonly '.esc_html(implode(' ',$tmp)).']'
 				.substr($content,$y+1,$l);
 		} else {
 			if (empty($SF_member_account)) {
@@ -472,15 +486,16 @@
 			} else if ($msg===false||isset($opt['false'])) {
 				$out=trim(preg_replace('/^<br(\s\/)?>|<br(\s\/)?>$/','',substr($content,$y+1,$l)));
 			} else if (is_singular()&&!empty($opt['nonmember-redirect'])) {
-				$out=(isset($opt['nomessage'])?'':('<span class="memberonly">'.__($msg).'</span>'))
-					.'<script>setTimeout('window.location="'.esc_url($opt['nonmember-redirect']).'"',2000);</script>';
+				$url=wp_validate_redirect(esc_url_raw($opt['nonmember-redirect']), '');
+				$out=(isset($opt['nomessage'])?'':('<div class="memberonly">'.wp_kses_post($msg).'</div>'))
+					.($url?('<script>setTimeout(function(){window.location.href='.wp_json_encode($url).';},2000);</script>'):'');
 				$opened=true;
 			} else if (is_singular()&&!$opened&&!empty($opt['nonmember'])) {
-				$out=(isset($opt['nomessage'])?'':('<div class="memberonly" style="margin-bottom:20px">'.__($msg).'</div>'))
+				$out=(isset($opt['nomessage'])?'':('<div class="memberonly" style="margin-bottom:20px">'.wp_kses_post($msg).'</div>'))
 					.'[mw open="'.$opt['nonmember'].'"]';
 			} else if (is_singular()&&!$opened&&(empty($SF_member_account)||!empty($SF_member_account['error']))&&!isset($opt['nologin'])) {
 				$out='<div class="memberonlywrapper" style="padding:40px 0 0;margin:40px 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd">'
-					.(isset($opt['nomessage'])?'':('<div class="memberonly" style="margin-bottom:20px">'.__($msg).'</div>'))
+					.(isset($opt['nomessage'])?'':('<div class="memberonly" style="margin-bottom:20px">'.wp_kses_post($msg).'</div>'))
 					.'<div id="SFctr" class="SF" data-sfi="1" data-org="'.esc_attr($settings['org']).'" data-ini="myaccount" data-zzz="'.esc_url(get_permalink()).'"'
 					.(empty($wpl)?'':' data-wpl="'.esc_url($wpl).'"')
 					.' style="position:relative;height:auto;margin-bottom:40px">'
@@ -494,7 +509,7 @@
 					define('DONOTROCKETOPTIMIZE',true);
 				$opened=true;
 			} else {
-				$out=(isset($opt['nomessage'])?'':('<span class="memberonly">'.__($msg).'</span>'));
+				$out=(isset($opt['nomessage'])?'':('<div class="memberonly">'.wp_kses_post($msg).'</div>'));
 			}
 		}
 		$content=substr_replace($content,$out,$x,$z-$x);
@@ -532,9 +547,9 @@
 				.(isset($opt['redirect'])?(' data-zzz="'.esc_url($opt['redirect']).'"'):'')
 				.(isset($opt['checkout'])?(' data-zgo="'.esc_url($opt['checkout']).'"'):'')
 				.(isset($opt['ini'])&&$opt['ini']=='0'?'':' data-sfi="1"')
-				.' style="'.(isset($opt['style'])?$opt['style']:'position:relative;height:auto').'">'
+				.' style="'.(isset($opt['style'])?esc_attr(safecss_filter_attr($opt['style'])):'position:relative;height:auto').'">'
 				.'<div id="SFpne" style="position:relative">'
-					.(empty($SF_page_data)?(isset($opt['ini'])&&$opt['ini']=='0'?'':'<div class="SFpne">Loading...</div>'):$SF_page_data['dtl'])
+					.(empty($SF_page_data)?(isset($opt['ini'])&&$opt['ini']=='0'?'':'<div class="SFpne">Loading...</div>'):sf_kses_post($SF_page_data['dtl']))
 				.'</div>'
 				.'<div id="SFfin" style="clear:both"></div>'
 				.(empty($settings['htm'])?'':'<script type="text/javascript" src="https://cdn.membershipworks.com/mfm.js"></script>')
@@ -545,55 +560,59 @@
 				define('DONOTROCKETOPTIMIZE',true);
 			$opened=true;
 		} else if (isset($opt['button'])) {
+			if (isset($opt['type'])&&!in_array($opt['type'],['a','button','span','div','img'],true))
+				unset($opt['type']);
 			$out=(isset($opt['type'])?('<'.$opt['type']):'<button')
 				.(isset($opt['type'])&&$opt['type']=='img'&&isset($opt['src'])?(' src="'.esc_url($opt['src']).'"'):'')
 				.(isset($opt['class'])?(' class="'.esc_attr($opt['class']).'"'):'')
 				.(isset($opt['style'])?(' style="'.esc_attr($opt['style']).'"'):' style="cursor:pointer;"')
-				.($opt['button']=='join'?(' onclick="if(typeof(SF)!='undefined')SF.open('account/join');">'.(isset($opt['text'])?$opt['text']:'Join')):'')
+				.($opt['button']=='join'?(' onclick="if(typeof(SF)!='undefined')SF.open('account/join');">'.(isset($opt['text'])?esc_html($opt['text']):'Join')):'')
 				.(isset($opt['type'])?($opt['type']=='img'?'':('</'.$opt['type'].'>')):'</button>');
 		} else if (isset($opt['join'])) {
+			if (isset($opt['type'])&&!in_array($opt['type'],['a','button','span','div','img'],true))
+				unset($opt['type']);
 			$out=(isset($opt['type'])?('<'.$opt['type']):'<a')
 				.(isset($opt['type'])&&$opt['type']=='img'&&isset($opt['src'])?(' src="'.esc_url($opt['src']).'"'):'')
 				.(isset($opt['class'])?(' class="'.esc_attr($opt['class']).'"'):'')
 				.(isset($opt['style'])?(' style="'.esc_attr($opt['style']).'"'):' style="cursor:pointer;"')
-				.(isset($opt['type'])&&$opt['type']!='a'?(' onclick="window.location.hash='account/join/'.$opt['join'].'';if(typeof(SF)!='undefined')setTimeout('SF.init()',50);">'):(' onclick="if(typeof(SF)!='undefined')setTimeout('SF.init()',50)" href="#account/join/'.$opt['join'].'">'))
-				.(isset($opt['text'])?$opt['text']:'Join')
+				.(isset($opt['type'])&&$opt['type']!='a'?(' onclick="window.location.hash='account/join/'.rawurlencode(rawurldecode($opt['join'])).'';if(typeof(SF)!='undefined')setTimeout('SF.init()',50);">'):(' onclick="if(typeof(SF)!='undefined')setTimeout('SF.init()',50)" href="#account/join/'.rawurlencode(rawurldecode($opt['join'])).'">'))
+				.(isset($opt['text'])?esc_html($opt['text']):'Join')
 				.(isset($opt['type'])?($opt['type']=='img'?'':('</'.$opt['type'].'>')):'</a>');
 		} else if (isset($opt['name'])||isset($opt['check'])) {
 			if (!isset($usl))
 				$usl=!empty($wpl)&&is_user_logged_in()&&get_user_meta(get_current_user_id(),'SF_ID',true)?wp_get_current_user():false;
-			$out=(isset($opt['name'])?'<span class="SFnam">'.(empty($usl)?'':$usl->display_name).'</span>':'')
-				.($opened||(isset($opt['name'])&&!empty($usl))?'':'<script>(function(){var i,j,a,x;try{x=localStorage.getItem("SF_nam");}catch(e){x="";}try{for(a=document.querySelectorAll(".SFnam"),i=a.length-1;i>=0;i--)a[i].innerHTML=x?x:"";}catch(e){}try{for(a=document.querySelectorAll(".SF_li"),i=a.length-1;i>=0;i--)a[i].style.display=x?"":"none";}catch(e){}try{for(a=document.querySelectorAll(".SF_lo"),i=a.length-1;i>=0;i--)a[i].style.display=x?"none":"";}catch(e){}})();</script>');
+			$out=(isset($opt['name'])?'<span class="SFnam">'.esc_html(empty($usl)?'':$usl->display_name).'</span>':'')
+				.($opened||(isset($opt['name'])&&!empty($usl))?'':'<script>(function(){var i,j,a,x;try{x=localStorage.getItem("SF_nam");}catch(e){x="";}try{for(a=document.querySelectorAll(".SFnam"),i=a.length-1;i>=0;i--)a[i].textContent=x?x:"";}catch(e){}try{for(a=document.querySelectorAll(".SF_li"),i=a.length-1;i>=0;i--)a[i].style.display=x?"":"none";}catch(e){}try{for(a=document.querySelectorAll(".SF_lo"),i=a.length-1;i>=0;i--)a[i].style.display=x?"none":"";}catch(e){}})();</script>');
 			if (!defined('DONOTCACHEPAGE'))
 				define('DONOTCACHEPAGE',true);
 		} else if (isset($opt['listlabel'])||isset($opt['listfolder'])) {
 			$dat=sf_api(empty($settings['ssl'])?'https':'http','GET','v1/dek',array('org'=>$settings['org'],'wem'=>1,'typ'=>isset($opt['listlabel'])?3:1,'lbl'=>isset($opt['listlabel'])?$opt['listlabel']:$opt['listfolder']));
 			if (!empty($dat)&&!empty($dat['error']))
-				$out=$dat['error'];
+				$out=esc_html($dat['error']);
 			else {
 				$out=array();
 				if (!empty($dat)) foreach($dat as $usr)
-					$out[]='<li><a href="'.$usr['url'].'">'.$usr['nam'].'</a></li>';
+					$out[]='<li><a href="'.esc_url($usr['url']).'">'.esc_html($usr['nam']).'</a></li>';
 				$out='<ul class="sf_list">'.implode('',$out).'</ul>';
 			}
 		} else if (isset($opt['listevents'])) {
 			$dat=sf_api(empty($settings['ssl'])?'https':'http','GET','v1/evt',array('org'=>$settings['org'],'wee'=>1,'grp'=>$opt['listevents'],'cnt'=>isset($opt['count'])?$opt['count']:'5','sdp'=>time()));
 			if (!empty($dat)&&!empty($dat['error']))
-				$out=$dat['error'];
+				$out=esc_html($dat['error']);
 			else {
 				$out=array();
 				if (!empty($dat)) foreach ($dat as $evt) {
 					$ts=explode(',',$evt['szp']);
 					if (!empty($evt['ezp'])&&($te=explode(',',$evt['ezp']))&&$te[0]==$ts[0])
 						$evt['ezp']=trim(implode(',',array_slice($te,1)));
-					$out[]='<li><a href="'.$evt['url'].'">'.$evt['ttl'].'</a><div class="event-when"><span class="event-start">'.$evt['szp'].'</span>'.(isset($evt['ezp'])&&$evt['ezp']?('<span class="event-sep"> - </span><span class="event-end">'.$evt['ezp'].'</span>'):'').'</div></li>';
+					$out[]='<li><a href="'.esc_url($evt['url']).'">'.wp_kses_post($evt['ttl']).'</a><div class="event-when"><span class="event-start">'.esc_html($evt['szp']).'</span>'.(isset($evt['ezp'])&&$evt['ezp']?('<span class="event-sep"> - </span><span class="event-end">'.esc_html($evt['ezp']).'</span>'):'').'</div></li>';
 				}
 				$out='<ul class="sf_list">'.implode('',$out).'</ul>';
 			}
 		} else if (isset($opt['eventwidget'])) {
 			$out=sf_widget_event_do(array_merge($opt,array('org'=>$settings['org'])),$settings);
 		} else if (isset($opt['folderwidget'])) {
-			$out=sf_widget_folder_do(array_merge($opt,array('org'=>$settings['org'])),$settings);
+			$out=sf_widget_folder_do(array_merge($opt,array('org'=>$settings['org'],'wid'=>null)),$settings);
 		} else {
 			$out='';
 		}
@@ -602,7 +621,7 @@
 	}
 	if (!$opened&&!empty($SF_page_data)&&($x=strpos($content,'<div id="SFpne" style="position:relative">'))!==false&&($y=strpos($content,'<div id="SFfin" style="clear:both">'))!==false) {
 		// replace again in case wp_autop mucks things up
-		$content=substr_replace($content,'<div id="SFpne" style="position:relative">'.$SF_page_data['dtl'].'</div>',$x,$y-$x);
+		$content=substr_replace($content,'<div id="SFpne" style="position:relative">'.sf_kses_post($SF_page_data['dtl']).'</div>',$x,$y-$x);
 	}
 	return $content;
 }
@@ -615,7 +634,7 @@
 	if (empty($dat))
 		return '<div>No current events</div>';
 	if (!empty($dat)&&!empty($dat['error']))
-		return '<div>'.$dat['error'].'</div>';
+		return '<div>'.esc_html($dat['error']).'</div>';
 	$out=array();
 	foreach ($dat as $x) {
 		$ts=explode(',',$x['szp']);
@@ -625,15 +644,15 @@
 		}
 		$out[]='<li class="event-item">'
 			.'<a class="event-link" href="'.esc_url($x['url']).'">'
-				.(empty($x['lgo'])||empty($instance['lgo'])?'':('<img class="event-thumb" src="//d1tif55lvfk8gc.cloudfront.net/'.$x['_id'].'s.jpg?'.$x['lgo'].'" alt="" style="max-width:100%"/>'))
-				.$x['ttl']
+				.(empty($x['lgo'])||empty($instance['lgo'])?'':('<img class="event-thumb" src="'.esc_url('//d1tif55lvfk8gc.cloudfront.net/'.$x['_id'].'s.jpg?'.$x['lgo']).'" alt style="max-width:100%"/>'))
+				.wp_kses_post($x['ttl'])
 			.'</a>'
-			.(empty($instance['szp'])||(empty($instance['exp'])&&!empty($x['ezp']))?('<div class="event-when">'
-				.(empty($instance['szp'])?('<span class="event-start">'.$x['szp'].'</span>'):'')
+			.(empty($instance['szp'])||(empty($instance['ezp'])&&!empty($x['ezp']))?('<div class="event-when">'
+				.(empty($instance['szp'])?('<span class="event-start">'.esc_html($x['szp']).'</span>'):'')
 				.(empty($instance['szp'])&&empty($instance['ezp'])&&!empty($x['ezp'])?'<span class="event-sep"> - </span>':'')
-				.(empty($instance['ezp'])&&!empty($x['ezp'])?('<span class="event-end">'.$x['ezp'].'</span>'):'')
+				.(empty($instance['ezp'])&&!empty($x['ezp'])?('<span class="event-end">'.esc_html($x['ezp']).'</span>'):'')
 			.'</div>'):'')
-			.(empty($instance['adn'])||empty($x['adn'])?'':('<div class="event-where">'.$x['adn'].'</div>'))
+			.(empty($instance['adn'])||empty($x['adn'])?'':('<div class="event-where">'.esc_html($x['adn']).'</div>'))
 			.'</li>';
 	}
 	return '<ul class="sf_widget_event_list" style="display:block;position:relative">'.implode($out).'</ul>';
@@ -691,20 +710,20 @@
 	$instance=wp_parse_args($instance,array('typ'=>'1','lbl'=>'Members','act'=>'0','delay'=>'10','nam'=>''));
 	$dat=sf_api(empty($settings)||empty($settings['ssl'])?'https':'http','GET','v1/dek',array('org'=>$instance['org'],'wem'=>1,'typ'=>empty($instance['typ'])?'1':$instance['typ'],'lbl'=>$instance['lbl']));
 	if (!empty($dat)&&!empty($dat['error']))
-		return '<div>'.$dat['error'].'</div>';
+		return '<div>'.esc_html($dat['error']).'</div>';
 	$out=array();
 	if (!empty($dat)) foreach($dat as $x) {
 		if ($instance['act']=='1')
 			$out[]='<li style="display:none;background-color:white;text-align:center;height:148px;padding:0;margin:0;table-layout:fixed;width:100%;"><a href="'.esc_url($x['url']).'" style="display:table-cell;vertical-align:middle;padding:10px;text-decoration:none;">'
-				.(empty($x['lgo'])?'':('<div class="member-image"><img src="https://cdn.membershipworks.com/u/'.$x['_id'].'_lgl.jpg?'.$x['lgo'].'" alt="'.(!empty($instance['nam'])?'':esc_attr($x['nam'])).'" onerror="this.parentNode.innerHTML=this.alt;" style="display:block;margin:0 auto;max-width:100%;max-height:75px;"></div>'))
-				.(empty($x['lgo'])||!empty($instance['nam'])?('<div class="member-name" style="display:block;width:100%;font-size:'.($x['lgo']?'1.1em':'1.5em').'">'.esc_html(html_entity_decode($x['nam'],ENT_HTML5|ENT_QUOTES)).'</div>'):'')
-				.(empty($x['cnm'])?'':('<small class="member-tagline" style="display:block;padding:10px;">'.esc_html(html_entity_decode($x['cnm'],ENT_HTML5|ENT_QUOTES)).'</small>'))
+				.(empty($x['lgo'])?'':('<div class="member-image"><img src="'.esc_url('https://cdn.membershipworks.com/u/'.$x['_id'].'_lgl.jpg?'.$x['lgo']).'" alt="'.(!empty($instance['nam'])?'':esc_attr($x['nam'])).'" onerror="this.parentNode.textContent=this.alt;" style="display:block;margin:0 auto;max-width:100%;max-height:75px;"></div>'))
+				.(empty($x['lgo'])||!empty($instance['nam'])?('<div class="member-name" style="display:block;width:100%;font-size:'.($x['lgo']?'1.1em':'1.5em').'">'.esc_html($x['nam']).'</div>'):'')
+				.(empty($x['cnm'])?'':('<small class="member-tagline" style="display:block;padding:10px;">'.wp_kses_post($x['cnm']).'</small>'))
 				.'</a></li>';
 		else
 			$out[]='<li><a href="'.esc_url($x['url']).'">'
-				.(empty($x['lgo'])||empty($instance['lgo'])?'':('<div class="member-image"><img src="https://cdn.membershipworks.com/u/'.$x['_id'].'_lgl.jpg?'.$x['lgo'].'" alt="" onerror="this.parentNode.innerHTML=this.alt;" style="display:block;margin:0 auto;max-width:100%;max-height:75px;"></div>'))
-				.'<span class="member-name">'.esc_html(html_entity_decode($x['nam'],ENT_HTML5|ENT_QUOTES)).'</span>'
-				.(empty($x['cnm'])?'':('<small class="member-tagline" style="display:block;">'.esc_html(html_entity_decode($x['cnm'],ENT_HTML5|ENT_QUOTES)).'</small>'))
+				.(empty($x['lgo'])||empty($instance['lgo'])?'':('<div class="member-image"><img src="'.esc_url('https://cdn.membershipworks.com/u/'.$x['_id'].'_lgl.jpg?'.$x['lgo']).'" alt style="display:block;margin:0 auto;max-width:100%;max-height:75px;"></div>'))
+				.'<span class="member-name">'.esc_html($x['nam']).'</span>'
+				.(empty($x['cnm'])?'':('<small class="member-tagline" style="display:block;">'.wp_kses_post($x['cnm']).'</small>'))
 				.'</a></li>';
 	}
 	$id=empty($instance['wid'])?('sf-widget-'.($SF_widgetid++)):$instance['wid'];
@@ -772,5 +791,3 @@
 	register_widget('sf_widget_folder');
 }
 add_action('widgets_init','sf_widgets_init');
-
-?>
 No newline at end of file

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-119643 - MembershipWorks <= 6.17 - Unauthenticated Stored Cross-Site Scripting via Member Name and Event Fields

$target_url = 'http://example.com'; // Change to the target WordPress site with MembershipWorks <= 6.17

// This PoC demonstrates the stored XSS via the 'nam' parameter in a shortcode-generated page.
// In a real attack, the payload would be injected into the MembershipWorks SaaS API data (e.g., by registering a member with a malicious name).
// Since the vulnerability is stored and requires API data manipulation, this script simulates the request that would render the vulnerable output.
// However, the actual injection point is not a direct HTTP parameter to WordPress; it's via API data.
// Therefore, a typical exploit would involve:
// 1. Registering a member or creating an event with malicious data in the MembershipWorks system.
// 2. Causing a page with the vulnerable shortcode to be rendered.
// This script cannot directly exploit the stored XSS without access to the SaaS API.
// Instead, we provide a generic example of how an attacker might craft a request to a page that includes the shortcode,
// but the actual payload is embedded in the stored data.
// For demonstration, we assume the attacker has already stored the payload and now triggers the page load.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/?p=123'); // Replace with a page containing the vulnerable shortcode
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($http_code == 200) {
    // Check if the malicious payload appears in the response (indicating stored XSS)
    // This check is for demonstration; in a real scenario, the payload would execute in a browser.
    if (strpos($response, '<script>alert(1)</script>') !== false) {
        echo "Vulnerable: Stored XSS payload found in response.n";
    } else {
        echo "Payload not found. The site may be patched or the payload not stored.n";
    }
} else {
    echo "Failed to retrieve page. HTTP code: $http_coden";
}

// Note: This PoC is limited because the vulnerability requires stored data manipulation.
// A complete exploit would involve interacting with the MembershipWorks API to inject the payload.
// For testing, manual injection into the API or database is needed.
?>

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.