VYPR
patchPublished Sep 9, 2026· 1 source

MapLibre GL JS Vulnerability Exposes Millions to Zero-Click Attacks

A critical cross-site scripting vulnerability (CVE-2026-85061) in MapLibre GL JS versions prior to 6.4.1 could allow attackers to execute arbitrary JavaScript in users' browsers without interaction, potentially affecting 2.7 million users.

A critical cross-site scripting vulnerability has been discovered in the widely-used MapLibre GL JS library, a popular open-source JavaScript mapping tool. This flaw, identified as CVE-2026-85061 and also cataloged as GitHub Security Advisory GHSA-jrc7-96c5-q579, affects versions 6.4.0 and earlier. The vulnerability poses a significant risk, potentially exposing applications and an estimated 2.7 million users to zero-click attacks.

The core of the vulnerability lies within the library's DOM.sanitize() function. This function is designed to strip potentially unsafe HTML attributes before rendering content on a web page. However, researchers found that the sanitizer's method of processing attributes through a live browser NamedNodeMap object created an exploitable condition. Specifically, when the function iterated through attributes and removed dangerous ones using elem.removeAttribute(), it caused an index-shifting issue. The subsequent attribute would move into the removed attribute's position, but the loop would advance to the next index, effectively skipping the newly positioned attribute.

This index-shifting flaw allows attackers to craft malicious HTML containing consecutive dangerous attributes. For instance, an attacker could include a legitimate attribute followed immediately by a malicious event handler. The MapLibre sanitizer might remove the first attribute but fail to inspect or remove the adjacent event handler due to the skipped index. When MapLibre subsequently inserts this surviving payload into the page, such as through its attribution control, the event handler can execute automatically without any user interaction.

The implications of this vulnerability are severe due to its zero-click nature. Exploitation requires no user interaction, authentication, or special privileges, making it particularly dangerous for services that dynamically load map styles, attribution text, or other mapping data from untrusted third-party sources. Applications that permit users to submit custom attributions are also at risk if this input is not independently validated and sanitized before being passed to MapLibre.

Successful exploitation could grant attackers the ability to execute arbitrary JavaScript within the security context of a victim's browser. Depending on the affected application's architecture, this could lead to a range of malicious outcomes, including session hijacking, unauthorized data access, redirection to phishing sites, or manipulation of the map content displayed to the user. The vulnerability has been assigned a critical severity rating under CVSS v3.1, with a score of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N, indicating network-based exploitation with low complexity and no user interaction required.

MapLibre maintainers have addressed the vulnerability by releasing version 6.4.1 of the library. The patch modifies the sanitizer's behavior by first creating a static copy of the element's attributes using Array.from(elem.attributes). This ensures that the code can safely inspect and remove attributes without altering the collection it is currently iterating over, thus preventing the index-shifting issue.

Organizations utilizing MapLibre GL JS are strongly advised to upgrade to version 6.4.1 or the latest available release immediately. Security teams should also conduct an audit of applications that process untrusted map style metadata or user-provided attribution strings. As a temporary mitigation, developers can sanitize attribution-related input before passing it to MapLibre, but upgrading the library remains the most robust solution to remediate this critical flaw.

Synthesized by Vypr AI