Vulnerabilities in pkg:npm/mapbox.js
PACKAGECVE-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.
pkg:npm/mapbox.js
Vulnerability advisories affecting package pkg:npm/mapbox.js. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-qr28-7j6p-9hmv | CVE-2017-1000042 | MODERATE | Content Injection via TileJSON attribute in mapbox.js |
| GHSA-q69p-5h74-w36f | CVE-2017-1000043 | MODERATE | Content Injection via TileJSON Name in mapbox.js |
CVE-2017-1000042 at a Glance
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).
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.
npm install mapbox.js@1.6.5
npm install mapbox.js@2.1.7
Upgrade mapbox-rails to 1.6.5
Upgrade mapbox-rails to 2.1.7
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
CVE-2017-1000042 Affected Mapbox.js Versions
4 component(s)| 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?
Which Mapbox.js versions are affected?
What version fixes CVE-2017-1000042?
Is mapbox.js affected?
Is mapbox-rails affected?
What is the CVSS score of CVE-2017-1000042?
What CWE is associated with CVE-2017-1000042?
How can I check npm dependencies for CVE-2017-1000042?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}