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.







