Vulnerabilities in pkg:npm/phantomjs
PACKAGECVE-2019-17221 is a HIGH (CVSS 7.5) phantomjs arbitrary file read vulnerability (CWE-552: Files or Directories Accessible to External Parties) affecting Phantomjs libraries in the npm ecosystem. The issue involves phantomjs arbitrary file read. Remediation is available in the latest vendor maintenance releases.
pkg:npm/phantomjs
Vulnerability advisories affecting package pkg:npm/phantomjs. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-x43g-gj9x-838x | CVE-2019-17221 | HIGH | PhantomJS Arbitrary File Read |
CVE-2019-17221 at a Glance
Security Impact
CVSS: 7.5
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:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2019-17221
To remediate this vulnerability, upgrade all affected Phantomjs 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 phantomjs@Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls phantomjs
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2019-17221, inspect your project dependencies using npm:
npm ls phantomjs
Analyze the terminal output to locate any version of Phantomjs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The npm ls phantomjs 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-552: Files or Directories Accessible to External Parties, where the product makes files or directories accessible to unauthorized actors, even though they should not be. In Phantomjs, 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-2019-17221 Affected Phantomjs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
phantomjs
|
npm |
≤ 2.1.1
|
|
References
Frequently Asked Questions
What is CVE-2019-17221?
Which Phantomjs versions are affected?
What version fixes CVE-2019-17221?
Is phantomjs affected?
What is the CVSS score of CVE-2019-17221?
What CWE is associated with CVE-2019-17221?
How can I check npm dependencies for CVE-2019-17221?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x43g-gj9x-838x",
"modified" : "2023-10-19T18:55:53Z",
"published" : "2022-05-24T22:01:03Z",
"aliases" : [ "CVE-2019-17221" ],
"summary" : "PhantomJS Arbitrary File Read",
"details" : "PhantomJS through 2.1.1 has an arbitrary file read vulnerability, as demonstrated by an XMLHttpRequest for a `file://` URI. The vulnerability exists in the `page.open()` function of the webpage module, which loads a specified URL and calls a given callback. An attacker can supply a specially crafted HTML file, as user input, that allows reading arbitrary files on the filesystem. For example, if `page.render()` is the function callback, this generates a PDF or an image of the targeted file. **NOTE**: this product is no longer developed.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "phantomjs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "2.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-17221"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Medium/phantomjs"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20191220171022/https://www.darkmatter.ae/blogs/breaching-the-perimeter-phantomjs-arbitrary-file-read"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-552" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-19T18:55:53Z",
"nvd_published_at" : "2019-11-05T14:15:00Z"
}
}