-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
remove defusedxml in favor of lxml #9840
Conversation
Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.
Note 🟢 Risk threshold not exceeded. Change Summary (click to expand)The following is a summary of changes in this pull request made by me, your security buddy 🤖. Note that this summary is auto-generated and not meant to be a definitive list of security issues but rather a helpful summary from a security perspective. Summary: The code changes in this pull request focus on improving the security and robustness of the various XML parsers used in the DefectDojo application security management tool. The key changes include:
These changes demonstrate a security-focused approach to the application's XML parsing functionality, addressing potential vulnerabilities and improving the overall quality and reliability of the security data processed by the tool. Files Changed:
Powered by DryRun Security |
FYI: I can do a followup PR to fix the added TRY200 regarding ruff linter, but I did prioritize this PR on migrating to lxml, but not on fixing all linter failures of previous implemented parsers. |
0d05ed6
to
0ba0ec8
Compare
I believe we originally started using
The defusedxml README describes these various vulnerabilities in more detail and provides some suggestions for safely using lxml. Additionally, lxml has some suggestions on their site. tl;dr: I think we should either do the legwork to make
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
0ba0ec8
to
4b9b5c6
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
@cneill, I updated how lxml is used (with resolve_entities=False) |
Could you also take a look @Maffooch if lxml is fine to be used like this? |
reopening to retrigger failed tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Friendly reminder @Maffooch |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@manuel-sommer I apologize for the delay on this one, and I thank you very much for your patience. After much deliberation, we believe it would be the best decision to remain with defusedXML. These are the high level reasons that contributed to that decision:
I agree with your intention of consolidating to a single XML parsing library, and we believe that defusedXML would be in the best interest of the project |
21f46f7
to
4b60cef
Compare
@manuel-sommer Thanks for all your hard work on this - once we did the research, it proved that defusedXML was the best path forward. We're going to update the "Writing a parser" to include instructions to use this library going forward. We'd probably not have done the research if you'd not done this PR so even though it didn't get merged, it DID help. 👍 |
DryRun Security SummaryThe pull request focuses on improving the security and robustness of the parser implementation in the DefectDojo project by emphasizing the use of secure libraries, recommending best practices for handling data, and emphasizing the importance of comprehensive unit testing. Expand for full summarySummary: The code changes in this pull request are focused on improving the security and robustness of the parser implementation in the DefectDojo project. The key changes include:
From an application security perspective, these changes are positive as they help to improve the overall security and reliability of the DefectDojo project by reducing the risk of vulnerabilities and improving the overall quality of the parser implementation. Files Changed:
Code AnalysisWe ran Riskiness🟢 Risk threshold not exceeded. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Quality Gate passedIssues Measures |
I would recommend to either go with lxml or defusedxml, but don't use a mixture of both.
https://discuss.python.org/t/status-of-defusedxml-and-recommendation-in-docs/34762/19
I chose lxml as defusedxml got the last update in March 2021