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

Module defusedxml.lxml is not fully protected and is deprecated #31

Open
glarrain opened this issue May 4, 2019 · 4 comments
Open

Module defusedxml.lxml is not fully protected and is deprecated #31

glarrain opened this issue May 4, 2019 · 4 comments
Labels

Comments

@glarrain
Copy link
Contributor

glarrain commented May 4, 2019

We rely on function defusedxml.lxml.fromstring() for our function libs.xml_utils.parse_untrusted_xml(). What should we use instead?

DEPRECATED Example code for lxml.etree protection
The code has NO protection against decompression bombs.

Source

defusedxml.lxml
DEPRECATED The module is deprecated and will be removed in a future release.

Source

CC @jtrh

Alternatives

Perhaps there are others?

  • defusedxml.ElementTree.fromstring
  • defusedxml.cElementTree.fromstring
@glarrain glarrain changed the title (draft) Module defusedxml.lxml will be deprecated (draft) Module defusedxml.lxml is not fully protected and will be deprecated May 4, 2019
@glarrain glarrain changed the title (draft) Module defusedxml.lxml is not fully protected and will be deprecated (draft) Module defusedxml.lxml is not fully protected and is deprecated May 4, 2019
@jtrh
Copy link
Contributor

jtrh commented May 6, 2019

The owner of the defusedxml repository is thinking of ways to solve this issue (the deprecation part, at least): tiran/defusedxml#38 (comment).

Is the function defusedxml.lxml.fromstring() they only part of defusedxml.lxml that we use?

@glarrain
Copy link
Contributor Author

glarrain commented May 6, 2019

Is the function defusedxml.lxml.fromstring() they only part of defusedxml.lxml that we use?

Yes. However, since that uses lxml, the XML-related classes that we reference all over the place in that project and others are aliases to lxml classes:

https://github.com/fyndata/lib-cl-sii-python/blob/cde9fe6e09a4e97bee55134c7419eb62fecd5111/cl_sii/libs/xml_utils.py#L31-L34

@glarrain glarrain changed the title (draft) Module defusedxml.lxml is not fully protected and is deprecated Module defusedxml.lxml is not fully protected and is deprecated May 6, 2019
@jtrh
Copy link
Contributor

jtrh commented Jul 21, 2020

SignXML removed the DefusedXML dependency by incorporating its useful parts. See XML-Security/signxml@83c05fb.

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

No branches or pull requests

2 participants