Skip to content

Update B313/B314 XML warning message for Python 3.11+#1365

Open
vishnudathks wants to merge 1 commit intoPyCQA:mainfrom
vishnudathks:main
Open

Update B313/B314 XML warning message for Python 3.11+#1365
vishnudathks wants to merge 1 commit intoPyCQA:mainfrom
vishnudathks:main

Conversation

@vishnudathks
Copy link
Copy Markdown

Summary

Updates B313 and B314 warning messages to accurately reflect that XML parsing vulnerabilities only apply to Python < 3.11. Python 3.11+ includes expat 2.7.1 which addresses historical XXE concerns.

Changes

  • Updated xml_msg in bandit/blacklists/calls.py to explain version-specific behavior
  • Message now informs users that vulnerabilities apply to Python < 3.11 only
  • Removed reference to deprecated defusedxml library

Testing

  • Ran bandit on test file and verified updated message displays correctly
  • Ran test suite: pytest tests/ - most tests pass, including test_xml

Related Issue

Fixes #1344

- Clarify that XML vulnerabilities only apply to Python < 3.11
- Python 3.11+ includes expat 2.7.1 which addresses XXE concerns
- Fixes issue PyCQA#1344
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.

using xml.etree.ElementTree.fromstring shouldn't raise errors in python versions 3.11 and up

1 participant