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

Add markupsafe.Markup XSS plugin #1225

Merged
merged 2 commits into from
Feb 4, 2025
Merged

Conversation

Daverball
Copy link
Contributor

Closes #1067

This adds a plugin matching the existing Ruff lint RUF035, including its two settings.

@Daverball
Copy link
Contributor Author

On an unrelated note: I've noticed that a lot of the call-related methods on Context (especially the ones for inspecting arguments) are completely broken. They're not used anywhere and their unit tests are heavily mocked. I'd suggest getting rid of them, since they only serve as pitfalls right now. If you want to keep them I would encourage you to switch to more representative tests using ast.parse.

bandit/plugins/markupsafe_markup_xss.py Outdated Show resolved Hide resolved
doc/source/plugins/b704_markupsafe_markup_xss.rst Outdated Show resolved Hide resolved
bandit/plugins/markupsafe_markup_xss.py Show resolved Hide resolved
bandit/plugins/markupsafe_markup_xss.py Outdated Show resolved Hide resolved
@ericwb ericwb merged commit 5e3e694 into PyCQA:main Feb 4, 2025
14 checks passed
@Daverball Daverball deleted the feat/markupsafe-xss branch February 5, 2025 07:00
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.

Flag markupsafe.Markup on non-literal content
3 participants