Skip to content
OpenAdvisories
High · 7.5 Public exploit CVE-2019-17221 EUVD-2022-5707GHSA-x43g-gj9x-838x

PhantomJS Arbitrary File Read

Published Nov 5, 2019 · Updated Aug 5, 2024 · Assigned by mitre

Description

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.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS phantomjs No fix yet —
Ubuntu 18.04 LTS phantomjs No fix yet —
Ubuntu 16.04 LTS phantomjs No fix yet —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

  • h4ckologic/CVE-2019-17221 ★ 8 · Jan 16, 2020

    PhantomJS uses internal module: webpage, to open, close, render, and perform multiple actions on webpages, which suffers from an arbitrary file read vulnerability. The vulnerability exists in the pag…

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
npm phantomjs <= 2.1.1 — GHSA-x43g-gj9x-838x

References