CVE-2026-85061: MapLibre GL JS: XSS Sanitizer Bypass in DOM.sanitize() via Live NamedNodeMap Removal Skip
MapLibre GL JS is an interactive vector tile map library for web browsers. Prior to 6.4.1, DOM.sanitize() in src/util/dom.ts iterates elem.attributes as a live NamedNodeMap while removeAttributes() removes attributes from the same collection, shifting indexes and skipping an adjacent dangerous attribute. An attacker who controls untrusted third-party style attribution strings or user-supplied custom attributions can supply consecutive dangerous attributes, causing an attribute such as onload or ontoggle to survive sanitization and execute when the attribution control inserts the content into innerHTML. A victim must render the affected map content for the script to execute. This issue is fixed in version 6.4.1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
MapLibre GL JSto a version that resolves this vulnerability.Fixed in 6.4.1
Event History
Frequently Asked Questions
Which applications are realistically exposed to this issue?
Applications using MapLibre GL JS before 6.4.1 are exposed if they render untrusted third-party style attribution strings or user-supplied custom attributions. The issue is triggered when the attribution control inserts that content into innerHTML.
What does an attacker need to exploit the flaw?
An attacker must be able to supply attribution content containing consecutive dangerous attributes. The live attribute collection can shift during sanitization, allowing an adjacent event-handler attribute such as onload or ontoggle to remain.
Is victim interaction required for exploitation?
No explicit user interaction is required, but a victim must render the affected map content. Script execution occurs when the vulnerable attribution content is inserted into the page.
How can I remediate the issue?
Upgrade MapLibre GL JS to version 6.4.1, which fixes the sanitizer iteration issue. Until upgrading, do not allow untrusted third parties or users to provide custom attribution strings, and avoid rendering untrusted style attributions.