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

MODERATE
Advisory Identifier: GHSA-q69p-5h74-w36f
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2017-1000043 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 name in mapbox.js. Remediation is available by upgrading affected packages to version 1.6.6, 2.2.4.

CVE-2017-1000043 at a Glance

CVE Identifier CVE-2017-1000043
GHSA Identifier GHSA-q69p-5h74-w36f
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.1/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-1000043

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.6
npm install mapbox.js@1.6.6
mapbox.js fixed: 2.2.4
npm install mapbox.js@2.2.4
mapbox-rails fixed: 1.6.6
Upgrade mapbox-rails to 1.6.6
mapbox-rails fixed: 2.2.4
Upgrade mapbox-rails to 2.2.4
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-1000043, 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.6), 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.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. After clicking on the share control, the malicious code will execute in the context of the page using Mapbox.js. ## Recommendation Version 1.x: Update to version 1.6.6 or later. Version 2.x: Update to version 2.2.4 or later.

CVE-2017-1000043 Affected Mapbox.js Versions

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

References

Frequently Asked Questions

What is CVE-2017-1000043?
CVE-2017-1000043 is a security vulnerability in Mapbox.js involving Content Injection via TileJSON Name 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.6, 2.2.4 across affected packages: mapbox.js, mapbox-rails.
What version fixes CVE-2017-1000043?
Upgrading to 1.6.6, 2.2.4 (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.6, 2.2.4. Upgrade your dependency to 1.6.6, 2.2.4 or later.
Is mapbox-rails affected?
Yes, mapbox-rails is affected in releases prior to 1.6.6, 2.2.4. Upgrade your dependency to 1.6.6, 2.2.4 or later.
What is the CVSS score of CVE-2017-1000043?
CVE-2017-1000043 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2017-1000043?
CVE-2017-1000043 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-1000043?
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-q69p-5h74-w36f",
  "modified" : "2023-03-27T22:19:37Z",
  "published" : "2018-11-09T17:48:34Z",
  "aliases" : [ "CVE-2017-1000043" ],
  "summary" : "Content Injection via TileJSON Name in mapbox.js",
  "details" : "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.\n\nIf `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. After clicking on the share control, the malicious code will execute in the context of the page using Mapbox.js.\n\n\n\n## Recommendation\n\nVersion 1.x: Update to version 1.6.6 or later.\nVersion 2.x: Update to version 2.2.4 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/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.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mapbox.js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "mapbox-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.6.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "mapbox-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-1000043"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/99245"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-q69p-5h74-w36f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/mapbox-rails/CVE-2017-1000043.yml"
  }, {
    "type" : "WEB",
    "url" : "https://nodesecurity.io/advisories/74"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/74"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:51:13Z",
    "nvd_published_at" : "2017-07-17T13:18:00Z"
  }
}