Skip to content

No longer using defusedxml since it is not necessary.#1179

Merged
mvantellingen merged 2 commits intomasterfrom
unknown repository
Apr 11, 2021
Merged

No longer using defusedxml since it is not necessary.#1179
mvantellingen merged 2 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jan 6, 2021

Closes #956
Closes #1014

It is not necessary to use defused when using the lxml parser. The package defusedxml.lxml is deprecated because of this.

The lxml parser uses libxml2 that has the guards against the vulnerabilities build in (at least libxml2 > 2.6). Since zeep already uses the lxml parser, this pull request removes defusedxml as a dependency. Some functionality regarding forbid_dtd and forbid_entities that were present in defusedxml is now present in loader.py and exceptions were added to zeep with the same name as in defusedxml.

  • dependency on defusedxml removed
  • added two new exception classes DTDForbidden en EntitiesForbidden
  • when loading a document the docinfo is checked for entities and doctype.

KlaasJan added 2 commits January 6, 2021 14:00
- mimicked behaviour from defused into the loader.py
- bumped lxml version to > 4.6.0
- mimicked behaviour from defused into the loader.py
- bumped lxml version to > 4.6.0
@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 7, 2021

Zie blurb on https://github.com/tiran/defusedxml/blob/master/defusedxml/lxml.py for an explanation:

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

@Yanonix
Copy link
Copy Markdown

Yanonix commented Mar 24, 2021

Have you an estimate date for a new release with this pull request ?
Thanks

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 24, 2021

I do not know, I haven't had any feedback on this PR from the owner. The repository seems very quiet.

@mvantellingen mvantellingen merged commit 9ff4b5a into mvantellingen:master Apr 11, 2021
@mvantellingen
Copy link
Copy Markdown
Owner

Looks good, thanks! This was on my todo list for a while

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants