CVE-2026-85061: MapLibre GL JS: XSS Sanitizer Bypass in DOM.sanitize() via Live NamedNodeMap Removal Skip
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 ).
Published Sep 8, 2026
Affected packages
maplibre-gl
- Ecosystem
- npm
- Affected
- <= 6.4.0
- Fixed in
- 6.4.1
- Check
npm ls maplibre-gl
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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 `). 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
References
- https://github.com/maplibre/maplibre-gl-js/security/advisories/GHSA-jrc7-96c5-q579
- https://nvd.nist.gov/vuln/detail/CVE-2026-85061
- https://github.com/maplibre/maplibre-gl-js/pull/8189
- https://github.com/maplibre/maplibre-gl-js/commit/1da69f3cd913a39fa948708e01478663bf48bc27
- https://github.com/maplibre/maplibre-gl-js/releases/tag/v6.4.1
- https://github.com/advisories/GHSA-jrc7-96c5-q579
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
