CVE-2026-85061: MapLibre GL JS: XSS Sanitizer Bypass in DOM.sanitize() via Live NamedNodeMap Removal Skip

Published Sep 3, 2026
·
Updated

Impact DOM.sanitize() in src/util/dom.ts iterated elem.attributes (a live NamedNodeMap) while calling elem.removeAttribute() in the same loop. Removing an attribute shifts subsequent attributes down by one index, causing the iterator to skip the adjacent attribute.

An attacker can provide an HTML payload with consecutive dangerous attributes (such as <details open onload="1" ontoggle="...">). The first attribute is stripped while the second survives and executes upon insertion into innerHTML via the attribution control without requiring user interaction (zero-click XSS).

Applications rendering untrusted/third-party style attribution strings or user-supplied custom attributions are impacted.

Patches The issue has been resolved by creating a static snapshot of attributes using Array.from(elem.attributes) before iteration. Please upgrade to maplibre-gl version 6.4.1 (or latest).

Workarounds Sanitizing the attribute field of a source before passing it down to maplibre

Other sources

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.

— NVD

Affected Software

2 affected componentsFixes available
MapLibre MapLibre GL JS<6.4.1
npm/maplibre-gl<=6.4.0
6.4.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/maplibre-gl to a version that resolves this vulnerability.

    Fixed in 6.4.1
  2. Upgrade

    Upgrade maplibre-gl to a version that resolves this vulnerability.

    Fixed in 6.4.1

Event History

Sep 3, 2026
CVE Published
via MITRE·08:18 PM
Data Sourced
via MITRE·08:18 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness
Sep 8, 2026
Advisory Published
via GitHub·08:50 PM
Data Sourced
via GitHub·08:50 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

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.

2

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.

3

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.

4

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203