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

Remove rule S410 #10030

Closed
ofek opened this issue Feb 18, 2024 · 4 comments · Fixed by #10154
Closed

Remove rule S410 #10030

ofek opened this issue Feb 18, 2024 · 4 comments · Fixed by #10154
Assignees
Labels
rule Implementing or modifying a lint rule

Comments

@ofek
Copy link
Contributor

ofek commented Feb 18, 2024

See this discussion https://discuss.python.org/t/status-of-defusedxml-and-recommendation-in-docs/34762

It may be valid to recommend the defusedxml third-party package over the standard library xml module but the lxml third-party package is the de facto way to work with XML in Python and any security issues which were previously a concern have been fixed and the defusedxml project even now documents that it is safe.

@charliermarsh
Copy link
Member

Would we need to augment the ruleset with new checks to ensure that lxml is being used with the appropriate defaults?

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Feb 20, 2024
@ofek
Copy link
Contributor Author

ofek commented Feb 20, 2024

Based on https://github.com/tiran/defusedxml#defusedxmllxml I was thinking you could check for etree.XMLParser(...) without an explicit resolve_entities=False but actually based on the documentation https://lxml.de/apidoc/lxml.etree.html#lxml.etree.XMLParser it seems the default has been changed to be safe so I think this rule should simply be removed.

@charliermarsh
Copy link
Member

Cool, I think we can remove it in v0.3.0.

@charliermarsh
Copy link
Member

Doing this now.

charliermarsh added a commit that referenced this issue Feb 28, 2024
## Summary

The `lxml` library has been modified to address known vulnerabilities
and unsafe defaults. As such, the `defusedxml`
library is no longer necessary, `defusedxml` has deprecated its `lxml`
module.

Closes #10030.
nkxxll pushed a commit to nkxxll/ruff that referenced this issue Mar 10, 2024
…#10154)

## Summary

The `lxml` library has been modified to address known vulnerabilities
and unsafe defaults. As such, the `defusedxml`
library is no longer necessary, `defusedxml` has deprecated its `lxml`
module.

Closes astral-sh#10030.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants