CVE-2022-4966 (HTML, published 2024-04-01T12:15Z)
Description: value: A vulnerability was found in sequentech admin-console up to 6.1.7 and classified as problematic. Affected by this issue is some unknown functionality of the component Election Description Handler. The manipulation leads to cross site scripting. The attack may be launched remotely. Upgrading to version 7.0.0-beta.1 is able to address this issue. The patch is identified as 0043a6b1e6e0f5abc9557e73f9ffc524fc5d609d. It is recommended to upgrade the affected component. VDB-258782 is the identifier assigned to this vulnerability.
Severity: nan (CVSS v3 base score: )
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/sequentech/admin-console
Files changed:
avAdmin/admin-directives/create/create.html
avAdmin/admin-directives/create/create.js
avAdmin/admin-directives/elections/elections.html
Commit message: Fix some XSS (#292) (#293)

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: https://github.com/sequentech/common-ui/pull/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.

Vulnerable code:
              <td ng-bind-html="election.description | addTargetBlank"></td>
          scope.log += "<p>" + text + "</p>";
          scope.log += "<p class=\"text-brand-danger\">" + text + "</p>";
                    data: {message: errorMsg},
                      data: errorData,
                  ng-bind-html="draft.description | htmlToText | truncate:150">
                  ng-bind-html="election.description | htmlToText | truncate:150">
                          ng-bind-html="childElection.description | htmlToText | truncate:150">

Fixed code:
              <td ng-bind="election.description | htmlToText | truncate:150"></td>
      $sanitize,
          scope.log += "<p>" + $sanitize(text) + "</p>";
          scope.log += "<p class=\"text-brand-danger\">" + $sanitize(text) + "</p>";
                    data: {message: $sanitize($sanitize)(errorMsg)},
                      data: $sanitize(errorData),
                  ng-bind="draft.description | htmlToText | truncate:150">
                  ng-bind="election.description | htmlToText | truncate:150">
                          ng-bind="childElection.description | htmlToText | truncate:150">