CVE-2017-1000042: Mapbox.js Content Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-qr28-7j6p-9hmv
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2017-1000042 is a MODERATE (CVSS 6.1) content injection vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Mapbox.js libraries in the npm ecosystem. The issue involves content injection via tilejson attribute in mapbox.js. Remediation is available by upgrading affected packages to version 1.6.5, 2.1.7.

CVE-2017-1000042 at a Glance

CVE Identifier CVE-2017-1000042
GHSA Identifier GHSA-qr28-7j6p-9hmv
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Mapbox.js
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

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

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

How to Fix CVE-2017-1000042

To remediate this vulnerability, upgrade all affected Mapbox.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.

mapbox.js fixed: 1.6.5
npm install mapbox.js@1.6.5
mapbox.js fixed: 2.1.7
npm install mapbox.js@2.1.7
mapbox-rails fixed: 1.6.5
Upgrade mapbox-rails to 1.6.5
mapbox-rails fixed: 2.1.7
Upgrade mapbox-rails to 2.1.7
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 mapbox.js

How to Check if You Are Affected

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

npm ls mapbox.js

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

Note: The npm ls mapbox.js 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 Mapbox.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

Versions 1.x prior to 1.6.5 and 2.x prior to 2.1.7 of `mapbox.js` are vulnerable to a cross-site-scripting attack in certain uncommon usage scenarios. If `L.mapbox.map` or `L.mapbox.tileLayer` are used to load untrusted TileJSON content from a non-Mapbox URL, it is possible for a malicious user with control over the TileJSON content to inject script content into the "attribution" value of the TileJSON which will be executed in the context of the page using Mapbox.js. ## Recommendation Version 2.x: Update to version 2.1.7 or later. Version 1.x: Update to version 1.6.5 or later.

CVE-2017-1000042 Affected Mapbox.js Versions

4 component(s)
Fixed Versions:
1.6.52.1.7
Product / Package Ecosystem Affected Versions Fixed Version
mapbox.js
npm
< 1.6.5
1.6.5
mapbox.js
npm
≥ 2.0.0
< 2.1.7
2.1.7
mapbox-rails
RubyGems
≥ 1.0.0
< 1.6.5
1.6.5
mapbox-rails
RubyGems
≥ 2.0.0
< 2.1.7
2.1.7

References

Frequently Asked Questions

What is CVE-2017-1000042?
CVE-2017-1000042 is a security vulnerability in Mapbox.js involving Content Injection via TileJSON attribute in mapbox.js under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Mapbox.js versions are affected?
Affected versions include releases prior to 1.6.5, 2.1.7 across affected packages: mapbox.js, mapbox-rails.
What version fixes CVE-2017-1000042?
Upgrading to 1.6.5, 2.1.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mapbox.js affected?
Yes, mapbox.js is affected in releases prior to 1.6.5, 2.1.7. Upgrade your dependency to 1.6.5, 2.1.7 or later.
Is mapbox-rails affected?
Yes, mapbox-rails is affected in releases prior to 1.6.5, 2.1.7. Upgrade your dependency to 1.6.5, 2.1.7 or later.
What is the CVSS score of CVE-2017-1000042?
CVE-2017-1000042 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2017-1000042?
CVE-2017-1000042 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-2017-1000042?
Run the dependency tree command: 'npm ls mapbox.js'. 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-qr28-7j6p-9hmv",
  "modified" : "2023-03-27T22:21:10Z",
  "published" : "2018-11-09T17:47:45Z",
  "aliases" : [ "CVE-2017-1000042" ],
  "summary" : "Content Injection via TileJSON attribute in mapbox.js",
  "details" : "Versions 1.x prior to 1.6.5 and 2.x prior to 2.1.7 of `mapbox.js` are vulnerable to a cross-site-scripting attack in certain uncommon usage scenarios.\n\nIf `L.mapbox.map` or `L.mapbox.tileLayer` are used to load untrusted TileJSON content from a non-Mapbox URL, it is possible for a malicious user with control over the TileJSON content to inject script content into the \"attribution\" value of the TileJSON which will be executed in the context of the page using Mapbox.js.\n\n\n\n## Recommendation\n\nVersion 2.x: Update to version 2.1.7 or later.\nVersion 1.x: Update to version 1.6.5 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mapbox.js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mapbox.js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "mapbox-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.6.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "mapbox-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-1000042"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/54327"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-qr28-7j6p-9hmv"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/mapbox-rails/CVE-2017-1000042.yml"
  }, {
    "type" : "WEB",
    "url" : "https://nodesecurity.io/advisories/49"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/49"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:52:39Z",
    "nvd_published_at" : "2017-07-17T13:18:00Z"
  }
}