CVE-2026-85061: MapLibre GL JS Cross-Site Scripting Vulnerability

CRITICAL
Advisory Identifier: GHSA-jrc7-96c5-q579
CVSS 10.0
CWE-79
Published
Advisory Summary

CVE-2026-85061 is a CRITICAL (CVSS 10.0) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting MapLibre GL JS libraries in the npm ecosystem. The issue involves xss sanitizer bypass in dom.sanitize() via live namednodemap removal skip. Remediation is available by upgrading affected packages to version 6.4.1.

CVE-2026-85061 at a Glance

CVE Identifier CVE-2026-85061
GHSA Identifier GHSA-jrc7-96c5-q579
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product MapLibre GL JS
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-85061

To remediate this vulnerability, upgrade all affected MapLibre GL JS dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

maplibre-gl fixed: 6.4.1
npm install maplibre-gl@6.4.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls maplibre-gl

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-85061, inspect your project dependencies using npm:

npm ls maplibre-gl

Analyze the terminal output to locate any version of MapLibre GL JS in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.4.1), your application is affected.

Note: The npm ls maplibre-gl command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In MapLibre GL JS, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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

CVE-2026-85061 Affected MapLibre GL JS Versions

1 component(s)
Fixed Versions:
6.4.1
Product / Package Ecosystem Affected Versions Fixed Version
maplibre-gl
npm
< 6.4.1
6.4.1

References

Frequently Asked Questions

What is CVE-2026-85061?
CVE-2026-85061 is a security vulnerability in MapLibre GL JS involving XSS Sanitizer Bypass in DOM.sanitize() via Live NamedNodeMap Removal Skip under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which MapLibre GL JS versions are affected?
Affected versions include releases prior to 6.4.1 across affected packages: maplibre-gl.
What version fixes CVE-2026-85061?
Upgrading to 6.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is maplibre-gl affected?
Yes, maplibre-gl is affected in releases prior to 6.4.1. Upgrade your dependency to 6.4.1 or later.
What is the CVSS score of CVE-2026-85061?
CVE-2026-85061 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2026-85061?
CVE-2026-85061 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-85061?
Run the dependency tree command: 'npm ls maplibre-gl'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jrc7-96c5-q579",
  "modified" : "2026-09-08T20:50:47Z",
  "published" : "2026-09-08T20:50:47Z",
  "aliases" : [ "CVE-2026-85061" ],
  "summary" : "MapLibre GL JS: XSS Sanitizer Bypass in DOM.sanitize() via Live NamedNodeMap Removal Skip",
  "details" : "### Impact\n`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.\n\nAn 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).\n\nApplications rendering untrusted/third-party style attribution strings or user-supplied custom attributions are impacted.\n\n### Patches\nThe 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).\n\n### Workarounds\nSanitizing the attribute field of a source before passing it down to maplibre",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "maplibre-gl"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.4.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/maplibre/maplibre-gl-js/security/advisories/GHSA-jrc7-96c5-q579"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-85061"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/maplibre/maplibre-gl-js/pull/8189"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/maplibre/maplibre-gl-js/commit/1da69f3cd913a39fa948708e01478663bf48bc27"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/maplibre/maplibre-gl-js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/maplibre/maplibre-gl-js/releases/tag/v6.4.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-08T20:50:47Z",
    "nvd_published_at" : "2026-09-03T21:17:23Z"
  }
}