maplibre-gl
Affected
- introduced
0, fixed6.4.1(semver)
Fixed versions
6.4.1
Fix
- Fixed version
6.4.1npm install [email protected]
Advisory
Also known as: CVE-2026-85061
MapLibre GL JS: XSS Sanitizer Bypass in DOM.sanitize() via Live NamedNodeMap Removal Skip
ImpactDOM.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
Critical Basis: The source's own band: CRITICAL
0, fixed 6.4.1 (semver)6.4.1
6.4.1npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0