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

Use defusedxml for untrusted xml data in deserialization #2829

Merged
merged 10 commits into from
Sep 10, 2024
Merged

Conversation

msyyc
Copy link
Member

@msyyc msyyc commented Sep 10, 2024

fix #2825

image

According to official docs https://docs.python.org/3/library/xml.html#the-defusedxml-package, for untrusted xml data, we shall use defusedxml when deserialization

@iscai-msft
Copy link
Contributor

@msyyc instead of adding a dep on a new library, I think we should just got # nosec like msrest and serialization code are doing right now (ex here). Thanks for doing it this safer way, but I think ultimately we shouldn't add a new library dep if possible, and since this is what we're currently doing, I'm comfortable going the # nosec route

@iscai-msft iscai-msft enabled auto-merge (squash) September 10, 2024 14:44
@iscai-msft iscai-msft merged commit 2005007 into main Sep 10, 2024
15 checks passed
@iscai-msft iscai-msft deleted the fix-xml branch September 10, 2024 15:05
@msyyc
Copy link
Member Author

msyyc commented Sep 11, 2024

@msyyc instead of adding a dep on a new library, I think we should just got # nosec like msrest and serialization code are doing right now (ex here). Thanks for doing it this safer way, but I think ultimately we shouldn't add a new library dep if possible, and since this is what we're currently doing, I'm comfortable going the # nosec route

I see and thank you for the context.

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.

[DPG] Bandit ci check reporting issue in the _deserialize_xml method
2 participants