Removed '| safe' usages in templates.#751
Merged
aebruno merged 1 commit intocoldfront:mainfrom Oct 1, 2025
Merged
Conversation
Signed-off-by: Eric Butcher <107886303+Eric-Butcher@users.noreply.github.com>
0ec49a2 to
2433844
Compare
ANekhai
approved these changes
Aug 28, 2025
ANekhai
left a comment
There was a problem hiding this comment.
I'm less familiar with these front end changes so they could use a second glance. I think they should be ok. The linter check failing is fixed in PR 734.
aebruno
approved these changes
Oct 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This remediates at least one (and possibly more) minor XSS exploits caused by usage of
| safetemplate markings when used inside of script tags. This has been remediated by placing all template-injected JavaScript data intojson_scripttemplate tags and then loading that JSON data inside of scripts usingJSON.parse().As part of this pull request, markup was removed from
AllocationCreateViewthat caused the value ofquantity_labelto be marked as<strong></strong>.This also introduces a new ruff linter check for "S308" checking improper usage of safe HTML injection into templates: https://docs.astral.sh/ruff/rules/suspicious-mark-safe-usage/.
Pull request #734 needs to be merged in first. These pull requests address similair issues. This PR will not pass ruff unless #734 is merged.