Content Injection via TileJSON Name

Module: mapbox.js

Published: January 12th, 2016

Reported by: Alexandra Ulsh, Abdullah Ahmet Erdem

CVE-NONE

CWE-

Vulnerable: <1.6.6 || < 2.2.4 > 2.0.0
Patched: >=1.6.6 <2.0.0 || >= 2.2.4

Overview

Mapbox.js versions 1.x prior to 1.6.6 and 2.x prior to 2.2.4 are vulnerable to a cross-site-scripting attack in certain uncommon usage scenarios.

If you use L.mapbox.map and L.mapbox.shareControl it is possible for a malicious user with control over the TileJSON content to inject script content into the name value of the TileJSON. After clicking on the share control, the malicious code will execute in the context of the page using Mapbox.js.

Such usage is uncommon. L.mapbox.shareControl is not automatically added to mapbox.js maps and must be explicitly added. The following usage scenarios are not vulnerable:

  • the map does not use a share control (L.mapbox.sharecontrol)
  • only trusted TileJSON content is loaded

Timeline: January 12, 2016 - CVE Requested

Remediation

Upgrade to Mapbox.js version 2.2.4. If you are still using a 1.x version and unable to upgrade to 2.2.4, upgrade to 1.6.6.

If you are unable to upgrade to either 2.2.4 or 1.6.6, you can also remove instances of L.mapbox.shareControl from your maps.

References

Sign up FREE for
nsp Continuous Security

Free for open source and the first private repo,
then just $1/mo per private repo