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

Fix some XSS #293

Merged
merged 1 commit into from
Jun 16, 2022
Merged

Fix some XSS #293

merged 1 commit into from
Jun 16, 2022

Conversation

edulix
Copy link
Contributor

@edulix edulix commented Jun 16, 2022

There was an issue with election description. During election creation,
we relied in ng-bind-html to sanitize the visualization of election
description before being sanitized by the backend (because it has not
yet been sent to the backend), but apparently it doesn't work for some
xss. The same issue happened in election list when showing the
description of the drafti election.

With this change, we always show the election description as plain text
so that we don't need to sanitize it. Also see related issue with
htmlToText in common-ui: sequentech/common-ui#221
because sometimes we also called to our own htmlToText angular filter,
and sanitization was also needed to happen there.

Another fix is to use $sanitize more pervasively in the election
creation screen, so that any reply from the server is also not trusted
and properly sanitized.

There was an issue with election description. During election creation,
we relied in ng-bind-html to sanitize the visualization of election
description before being sanitized by the backend (because it has not
yet been sent to the backend), but apparently it doesn't work for some
xss. The same issue happened in election list when showing the
description of the drafti election.

With this change, we always show the election description as plain text
so that we don't need to sanitize it. Also see related issue with
htmlToText in common-ui: sequentech/common-ui#221
because sometimes we also called to our own htmlToText angular filter,
and sanitization was also needed to happen there.

Another fix is to use $sanitize more pervasively in the election
creation screen, so that any reply from the server is also not trusted
and properly sanitized.
@edulix edulix merged commit 0043a6b into master Jun 16, 2022
@edulix edulix deleted the security-fix-draft-election-master branch June 16, 2022 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant