Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-5122 Overview
CVE-2025-5122 is a stored Cross-Site Scripting (XSS) vulnerability [CWE-79] in the Map Block Leaflet plugin for WordPress. The flaw affects all plugin versions up to and including 3.2.1. It stems from insufficient input sanitization and output escaping on the url parameter inside the plugin's block render routine. Authenticated users with Contributor-level permissions or higher can inject arbitrary JavaScript into pages. The injected script executes in the browser context of any visitor who loads the affected page, enabling session theft, forced redirects, or administrative action abuse via logged-in administrators.
Critical Impact
Authenticated contributors can store malicious JavaScript that executes against site visitors and administrators, enabling account takeover through session or cookie theft.
Affected Products
- Map Block Leaflet plugin for WordPress — all versions up to and including 3.2.1
- WordPress sites that permit Contributor-level or higher registration
- Sites rendering content via the plugin's render.php block handler
Discovery Timeline
- 2025-05-29 - CVE-2025-5122 published to the National Vulnerability Database (NVD)
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-5122
Vulnerability Analysis
The Map Block Leaflet plugin exposes a Gutenberg block that accepts a url attribute used to source map tiles or related resources. The block's render script, located at build/leaflet-map-block/render.php, writes this attribute into the HTML output without applying sufficient sanitization or escaping functions such as esc_url() or esc_attr().
Because WordPress Contributors can create and save blocks containing arbitrary attributes before publication, an attacker in that role can craft a url payload that breaks out of the intended HTML attribute context. When an editor previews or an administrator approves and publishes the post, the stored payload executes in every visitor's browser.
The scope change in the CVSS vector (S:C) reflects that the injected script runs in the context of the broader WordPress site, affecting users beyond the attacker's own account boundary.
Root Cause
The root cause is missing output escaping on a user-controlled block attribute. The url parameter flows from post metadata into rendered HTML without passing through WordPress escaping APIs. This is a classic Improper Neutralization of Input During Web Page Generation issue tracked under CWE-79.
Attack Vector
The attack requires network access to the WordPress site and authenticated access at the Contributor role or above. The attacker inserts a Map Block Leaflet block into a draft post and supplies a malicious url attribute containing JavaScript. Once the post is viewed or published, the payload executes in victim browsers. No user interaction beyond loading the page is required.
See the Wordfence Vulnerability Analysis and the vulnerable WordPress Plugin Render Script for technical details. No public proof-of-concept exploit code is referenced in the advisory.
Detection Methods for CVE-2025-5122
Indicators of Compromise
- Post or page content containing Map Block Leaflet blocks with url attribute values that include javascript:, <script>, event handlers such as onerror= or onload=, or HTML-breaking characters like " and >.
- Unexpected outbound requests from visitor browsers to attacker-controlled domains originating from pages that embed the plugin's block.
- New or recently modified posts authored by Contributor-level accounts that embed the plugin block.
- WordPress audit log entries showing block attribute changes containing encoded script payloads.
Detection Strategies
- Scan the wp_posts table for serialized block markup containing wp:leaflet-map-block with suspicious url values.
- Enable a Content Security Policy (CSP) in report-only mode to surface inline script executions triggered by rendered pages.
- Review web server access logs for referrers or request patterns indicating script execution against administrative sessions.
Monitoring Recommendations
- Monitor creation and modification events for Contributor-authored posts that include map blocks.
- Alert on administrator sessions originating from unexpected geographic locations shortly after viewing posts containing the plugin block.
- Track plugin version inventory across managed WordPress sites and flag installations at 3.2.1 or below.
How to Mitigate CVE-2025-5122
Immediate Actions Required
- Update the Map Block Leaflet plugin to the patched release available through the WordPress Plugin repository.
- Audit all existing posts and pages for Map Block Leaflet blocks and inspect the url attribute for malicious content.
- Review Contributor and Author accounts for unexpected registrations or compromised credentials and reset passwords where appropriate.
- Rotate administrator session tokens by forcing logout of all users after remediation.
Patch Information
The vendor addressed the vulnerability in WordPress Changeset #3302407, which introduces sanitization and escaping on the url block attribute. Site operators should upgrade to the first release that incorporates this changeset. Confirm the installed version in the WordPress admin plugin list after upgrade.
Workarounds
- Deactivate and remove the Map Block Leaflet plugin until it can be upgraded.
- Restrict Contributor-level registrations and require editorial review before any post using the plugin block is published.
- Deploy a Web Application Firewall (WAF) rule to strip or block requests containing script payloads in Map Block Leaflet block attributes.
- Implement a strict Content Security Policy that disallows inline scripts and restricts script sources to trusted origins.
# Configuration example: query WordPress for vulnerable block usage
wp db query "SELECT ID, post_title, post_status, post_author \
FROM wp_posts \
WHERE post_content LIKE '%wp:leaflet-map-block%' \
AND post_content REGEXP '(javascript:|<script|onerror=|onload=)';"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

