Skip to content
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

Vulnernable to SSRF when letting users convert custom html #249

Closed
vixriihi opened this issue Nov 20, 2019 · 3 comments
Closed

Vulnernable to SSRF when letting users convert custom html #249

vixriihi opened this issue Nov 20, 2019 · 3 comments

Comments

@vixriihi
Copy link

vixriihi commented Nov 20, 2019

This library is vulnerable to Server-Side Request Forgery (SSRF) when users can input the html being converted to pdf.

@skarger
Copy link

skarger commented Aug 3, 2020

The NPM advisory for this causes yarn audit to fail, but there's no fix available. Preventing the server from fetching URLs would prevent the rendering of the PDF.

https://www.npmjs.com/advisories/1339

Is it possible to close this advisory? Or release a new version of this package as a workaround to satisfy yarn audit?

The overall security vulnerability does exist. If you run this on a server that can access sensitive URLs, and render HTML using user-provided content, then a malicious user could embed a target URL and prompt the server to fetch that URL into the rendered PDF, for example with image or iframe URLs.

In general though, fetching URLs is necessary to render the HTML and ultimately the PDF. A basic solution for users of this package is to prevent their server from having access to sensitive URLs. Another possible solution, depending on the application, would be to configure their server to only have access to a specific set of safe URLs.

@westy92
Copy link
Owner

westy92 commented Aug 15, 2020

Version 0.6.1 has been released and I have included a Security section. I have pinged npm about the advisory.

@westy92
Copy link
Owner

westy92 commented Sep 3, 2020

The advisory has been removed from both npm and Snyk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@westy92 @skarger @vixriihi and others