Skip to content

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 draft 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 force-pushed the security-fix-draft-election branch 2 times, most recently from 196ede3 to 2fc0e43 Compare June 16, 2022 12:38
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 force-pushed the security-fix-draft-election branch from 2fc0e43 to 5348219 Compare June 16, 2022 12:44
@edulix edulix changed the title Fixing XSS in election description Fix some XSS Jun 16, 2022
@edulix edulix merged commit c4d1f50 into 6.1.x Jun 16, 2022
@edulix edulix deleted the security-fix-draft-election branch June 16, 2022 13:20
edulix added a commit that referenced this pull request 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.
edulix added a commit that referenced this pull request 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.
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.

2 participants