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

Add linter for insecure xmltodict use #6

Open
mschwager opened this issue Jan 10, 2020 · 0 comments
Open

Add linter for insecure xmltodict use #6

mschwager opened this issue Jan 10, 2020 · 0 comments

Comments

@mschwager
Copy link
Contributor

The xmltodict library is a widely used XML parsing module. We should check for insecure use of this library. A couple checks come to mind:

  • The most obvious, and easiest, would be checking for falsey values in the disable_entities kwarg.
  • A more interesting and in-depth check would be checking if defusedexpat is installed. The library checks for this like so:
try:
    from defusedexpat import pyexpat as expat
except ImportError:
    from xml.parsers import expat

This means if it's not installed then the library is wide open to various XML attacks similar to those prevented in defusedxml. Further, the defusedexpat library itself appears to be unmaintained, so there may be some insecurities we could search for there as well.

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

No branches or pull requests

1 participant