CVE-2017-1000042: Content Injection via TileJSON attribute in mapbox.js

mapbox.js Updated 02 Oct 2025

Summary

09/11/2018
Yes i
Moderate
6.1

CVE-2017-1000042: Content Injection via TileJSON attribute in mapbox.js. Affects mapbox.js across 2 version ranges.

< 1.6.5 >= 2.0.0, < 2.1.7

Fixed in 1.6.5 or 2.1.7, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

mapbox.js is an open-source JavaScript library that provides a set of tools for creating interactive maps on the web. It allows developers to integrate maps and geospatial functionality into their applications. However, versions 1.x prior to 1.6.5 and 2.x prior to 2.1.7 of mapbox.js are vulnerable to a content injection vulnerability via the TileJSON attribute. This vulnerability can be exploited in certain uncommon usage scenarios, allowing a malicious user to inject script content into the 'attribution' value of the TileJSON, which will be executed in the context of the page using Mapbox.js.

Vulnerability Detail

The content injection vulnerability in mapbox.js arises when untrusted TileJSON content from a non-Mapbox URL is loaded using the 'L.mapbox.map' or 'L.mapbox.tileLayer' functions. An attacker with control over the TileJSON content can manipulate the 'attribution' value to inject malicious script content. When the map is rendered, the injected script will be executed in the context of the page, potentially leading to cross-site scripting (XSS) attacks. This vulnerability has a CVSS score of 6.1, indicating a moderate severity level.

How To Fix

Latest published version: 3.3.1 as of 23 Oct 2026

npm install mapbox.js@3.3.1

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.6.5 1.6.5
    npm install mapbox.js@1.6.5
  • >= 2.0.0, < 2.1.7 2.1.7
    npm install mapbox.js@2.1.7

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround provided for this vulnerability. It is crucial to update to the patched versions of mapbox.js to ensure the security of the application.

Conclusion

In conclusion, the content injection vulnerability in mapbox.js can be exploited by a malicious user to inject script content into the 'attribution' value of the TileJSON, potentially leading to cross-site scripting attacks. It is crucial to update to the latest patched versions of mapbox.js to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mapbox.js →

Share this vulnerability

FAQ

mapbox.js is an open-source JavaScript library that provides tools for creating interactive maps on the web.

Versions 1.x prior to 1.6.5 and 2.x prior to 2.1.7 of mapbox.js are affected.

The vulnerability allows an attacker to inject malicious script content into the 'attribution' value of the TileJSON, potentially leading to cross-site scripting (XSS) attacks.

To fix this vulnerability, update to the latest version of mapbox.js (2.1.7 or later for version 2.x, and 1.6.5 or later for version 1.x).

No specific workaround is available. Updating to the patched versions is the recommended solution.

Related vulnerabilities

Recent vulnerabilities recorded for mapbox.js.

How To Fix

Latest published version: 3.3.1 as of 23 Oct 2026

npm install mapbox.js@3.3.1

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.6.5 1.6.5
    npm install mapbox.js@1.6.5
  • >= 2.0.0, < 2.1.7 2.1.7
    npm install mapbox.js@2.1.7

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback