-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent local file access by default #616
Conversation
β¦false` option BREAKING CHANGE: Prevent local file access by default to fix a security issue. Please provide the `localUrlAccess: true` option if you want to keep the old behavior but keep your system vulnerable to local file access.
a29aa70
to
d2ad4e8
Compare
d2ad4e8
to
9d90212
Compare
@@ -35,6 +35,8 @@ function PDF (html, options) { | |||
if (this.options.filename) this.options.filename = path.resolve(this.options.filename) | |||
if (!this.options.phantomPath) this.options.phantomPath = phantomjs && phantomjs.path | |||
this.options.phantomArgs = this.options.phantomArgs || [] | |||
|
|||
if (this.options.localUrlAccess) this.options.phantomArgs.push('--local-url-access=false') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I crazy or is this inverted? if localUrlAccess is false (which it is by default, for security reasons), this option never gets set for phantomjs to disallow local url access? Are the tests inverted as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah. oops.
should we push it as fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case you didn't already go ahead and fix it, I created a PR here to address this #623
Changelog
localUrlAccess: false
optionπ₯ Breaking Change
Prevent local file access by default to fix a security issue.
Please provide the
localUrlAccess: true
option if you want to keep the old behaviorbut keep your system vulnerable to local file access.
Not sure this module is even usable without installing phantomjs manually.
On linux you might need to download the executable.
The tests are running locally on macos. I'll publish this as version 3.