Skip to content

Update html-to-text to fix uncontrolled memory consumption #13

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

Merged
merged 4 commits into from
Apr 22, 2021
Merged

Update html-to-text to fix uncontrolled memory consumption #13

merged 4 commits into from
Apr 22, 2021

Conversation

sseide
Copy link
Contributor

@sseide sseide commented Apr 22, 2021

Current version of prod dependency html-to-text has a problem rendering specially crafted html templates leading to a memory exhaustion on the server running this code. A fix (with high memory limits to stop this kind of attack) and options to better control this behaviour for untrusted content was applied to html-to-text@6.0.0

This PR updates the html-to-text library to the latest 7.x release.
When using options passed to html-to-text they must be re-evaluated with the html-to-text documentation as release 6.x changed some of them. Update instructions can be found on the github page https://github.com/html-to-text/node-html-to-text

Note: This update needs at least NodeJS 10.23, older node releases are not supported by html-to-text. But Node 8.x and older is End-of-life for some time by now and everyone should have updated, therefore not a problem.

Together with this prod dependency i updated dev dependencies mocha and grunt fixing multiple security warnings within their own dependencies and fixed the deprecated usage of new Buffer() within the test cases.

All tests are green and within our own apps the updated version works too without any problems, only options needed to be adapted.

More information about the problem can be found here: https://app.snyk.io/vuln/SNYK-JS-HTMLTOTEXT-571464 and html-to-text/node-html-to-text#172

Please release a new version to NPM afterwards. As these fix contains breaking changes (minimum NodeJS and option handling) a major version update may be recommended.

Thanks,
Stefan Seide

@sseide sseide changed the title Update text-to-html to fix uncontrolled memory consumption Update html-to-text to fix uncontrolled memory consumption Apr 22, 2021
@andris9 andris9 merged commit c43da1f into andris9:master Apr 22, 2021
@andris9
Copy link
Owner

andris9 commented Apr 22, 2021

Published as v3.2.0

@sseide sseide deleted the update_test_to_html branch April 22, 2021 19:03
@sseide
Copy link
Contributor Author

sseide commented Apr 22, 2021

Many thanks for the fast response.

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

Successfully merging this pull request may close these issues.

None yet

2 participants