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

security: Do not render blocks in Jinja message templates #5002

Merged
merged 6 commits into from
Jul 24, 2024

Conversation

metroid-samus
Copy link
Contributor

This PR prevents Jinja blocks from being executed. This occurs when messages are rendered.

@metroid-samus metroid-samus added the bug Something isn't working label Jul 23, 2024
@metroid-samus metroid-samus self-assigned this Jul 23, 2024
@metroid-samus metroid-samus marked this pull request as ready for review July 23, 2024 23:35
@wssheldon wssheldon changed the title Do not render blocks in message templates security: Do not render blocks in Jinja message templates Jul 24, 2024
@metroid-samus metroid-samus merged commit c1626bf into master Jul 24, 2024
8 checks passed
@metroid-samus metroid-samus deleted the bugfix/dont-render-message-template-blocks branch July 24, 2024 17:07
metroid-samus added a commit that referenced this pull request Sep 25, 2024
* Do not render blocks in message templates

* Render messages in a sandboxed environment.

* Add tests.

* Use ImmutableSandboxedEnvironment instead

* Adds end block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants