ol-th / pdf-img-convert.js

Simple node package to convert a PDF into images.
MIT License
161 stars 38 forks source link

Enable setting isEvalSupported parameter #56

Open tmoran-stenoa opened 3 months ago

tmoran-stenoa commented 3 months ago

As evidenced by the recent vulnerability found in pdf.js, arbitrary string execution in JS is always a potential danger, no matter how many precautions are taken to prevent arbitrary code execution.

This PR allows setting the isEvalSupported to false so this can be disabled while parsing the PDF.

Important note!

The default value in this PR is true (as is currently the case). Theoretically, it should be fine to set the default to false, as it appears isEvalSupported is only used for performance gains, but to be 100% sure that existing code doesn't break, this PR maintains the current behaviour. Feel free to change this.