Description
Versions 1.x prior to 1.6.6 and 2.x prior to 2.2.4 of mapbox.js are vulnerable to a cross-site-scripting attack in certain uncommon usage scenarios.
If L.mapbox.map or L.mapbox.shareControl are used in a manner that gives users control of the TileJSON content, it is possible to inject script content into the name value of the TileJSON.
Recommendation
Update the mapbox.js package to the latest compatible version. Followings are version details:
Affected version(s): **>= 2.0.0, < 2.2.4 < 1.6.6** Patched version(s): **2.2.4 1.6.6**
References
Could your website be exposed too?
SmartScanner can check your website for Content Injection via TileJSON Name in mapbox.js and gives you actionable findings to investigate.
Start a free scanRelated Issues
- Content Injection via TileJSON attribute in mapbox.js - CVE-2017-1000042
- OpenZeppelin Contracts Wizard has Code Injection in Generated Hardhat and Foundry Tests via Unsanitized opts.name / opts - CVE-2026-48054
- xmldom: Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the - CVE-2026-83609
- Unhead has XSS bypass in `useHeadSafe` via attribute name injection and case-sensitive protocol check - CVE-2026-31860


