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

Hardening suggestions for codemodder-python / xml-sonar #306

Closed
wants to merge 3 commits into from

Conversation

pixeebot[bot]
Copy link
Contributor

@pixeebot pixeebot bot commented Feb 26, 2024

I've reviewed the recently opened PR (305 - testing sonarcloud) and have identified some area(s) that could benefit from additional hardening measures.

These changes should help prevent potential security vulnerabilities and improve overall code quality.

Thank you for your consideration!

docs | feedback
Powered by: pixeebot

@pixeebot pixeebot bot requested a review from drdavella as a code owner February 26, 2024 11:33
@pixeebot pixeebot bot requested a review from clavedeluna February 26, 2024 11:33

parser = etree.XMLParser()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace lxml parser parameters with safe defaults.

@@ -1,5 +1,5 @@
import lxml.etree

parser = lxml.etree.XMLParser()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace lxml parser parameters with safe defaults.


parser = etree.XMLParser()
tree = etree.parse("xxe.xml", parser)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call lxml.etree.parse and lxml.etree.fromstring with a safe parser.

@@ -1,5 +1,5 @@
import lxml.etree

parser = lxml.etree.XMLParser()
tree = lxml.etree.parse("xxe.xml", parser)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call lxml.etree.parse and lxml.etree.fromstring with a safe parser.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@clavedeluna
Copy link
Contributor

Thanks pixeebot!

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

Successfully merging this pull request may close these issues.

1 participant