Skip to content

Conversation

@Eric-Butcher
Copy link
Contributor

@Eric-Butcher Eric-Butcher commented Aug 7, 2025

This remediates at least one (and possibly more) minor XSS exploits caused by usage of | safe template markings when used inside of script tags. This has been remediated by placing all template-injected JavaScript data into json_script template tags and then loading that JSON data inside of scripts using JSON.parse().

As part of this pull request, markup was removed from AllocationCreateView that caused the value of quantity_label to 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.

Copy link

@ANekhai ANekhai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 aebruno merged commit 35f2c8a into coldfront:main Oct 1, 2025
1 check failed
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.

3 participants