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

parsing/transforming xml could lead to leaks #66

Closed
kares opened this issue Jan 15, 2020 · 0 comments · Fixed by #68
Closed

parsing/transforming xml could lead to leaks #66

kares opened this issue Jan 15, 2020 · 0 comments · Fixed by #68

Comments

@kares
Copy link
Contributor

kares commented Jan 15, 2020

Nokogiri installs a XML error handler, this handler keeps a list of warning/errors.
Each warning or error is internally represented as a org.xml.sax.SAXParseException.
These are than available as (transformed) XML errors using doc.errors ...

Growing the error list is tied to the document but is not bounded -> many (failing) transformations will cause the list to grow. This could lead to potential memory leaks.

We need a few reproducers for filling the error list - potentially one during parsing and also verify whether the list could potentially grow during transformation or xpath extraction.

A reasonable resolution for the issue would be to introduce a configuration for parse options to allow an XML document to be created in strict mode - in this mode exceptions bubble up (instead of being stored). The plugin should than potentially log the errors and tag the event with a parse failure ...

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 a pull request may close this issue.

1 participant