-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
defusedxml & lxml - thoughts #221
Comments
Also funny that the README states on the dependencies section:
while the |
I saw it was adopted by pysaml2 and you included it there too last year. I remember I started to use it time ago, when someone reported XEE issues on php-saml ...then I searched a solution for python... and found that library, to be honest I saw its readme, tried some attack vectors and review its code for a while, but I have not reviewed it deeper. Are you guys planing to use something different? Related to the sentence of the description of defusexml, "XML bomb protection for Python stdlib modules", is its description on pypi The fix for the vulnerability was a patch to solve the issue asap. I plan to analyze if a redesign on the toolkit is possible following leif recommendations. |
No plans yet, though, I will try to explain what I am thinking. It is my opinion that every library that one's project is using, is effectively the project's code (even if it happens through indirection - a dependency). At this point, I am very skeptical of whether the way the parser works should be delegated to an external library, or if it should be configured by the project to meet the project's specific needs. I am leaning to the latter, which effectively means that we should define a module that explicitly defines the way that the xml parser works. This would be duplicating some of the things that To go further, I would define a module that represents the actions on xml documents that I need, and proxy those to the selected xml implementation ( btw, I went through many projects the last couple of days, to see how things in python and xml have evolved, and I am not particularly excited. I will try to find time to try some things out and try to report back with more information. |
Thanks for taking the time for such research. |
Hi there,
I am opening this as a discussion around
lxml
anddefusedxml
and their relation. Feel free to close it at anytime. It seems that many projects are usingdefusedxml
but the project itself seems to be unresponsive for a year now.In relation to
lxml
, it states that thedefusedxml.lxml
module is an example. This is one thing to keep in mind.This is combined with the other comment:
The other thing that I see (also in relation to the duo vulnerability and the fix) is that
lxml
has a parser option to discard comments, namelyremove_comments
. I would feel much better with that than watching out for.text
related operations and treating them specially. This is whatdefusedxml
does, it replaces the default parser, but unfortunately it omits that option.Finally, requesting
defusedxml
does not requestlxml
, butlxml
is used throughout this project. Atm,lxml
is installed throughdm.xmlsec.binding
, but I would add it as a dependency for this project explicitly.The text was updated successfully, but these errors were encountered: