]> source.dussan.org Git - jquery-ui.git/commit
Checkboxradio: Don't re-evaluate text labels as HTML
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Thu, 14 Jul 2022 18:52:02 +0000 (20:52 +0200)
committerGitHub <noreply@github.com>
Thu, 14 Jul 2022 18:52:02 +0000 (20:52 +0200)
commit8cc5bae1caa1fcf96bf5862c5646c787020ba3f9
treecc2db46ecf233161eaeebae0a6f8ebf82da53075
parentb53e7beb6884a8de7710146112bc48aecd8737b4
Checkboxradio: Don't re-evaluate text labels as HTML

If you generate a Checkboxradio from a checkbox/radio with a label that
contains encoded HTML, e.g. `&lt;em&gt;test&lt;/em&gt;` this will work fine
at first. If, however a refresh is triggered on that instance (explicitly or
e.g. by turning it into a `Controlgroup`), the previously escaped HTML will
now be evaluated.

If the label was created based on some user input, this could lead to
unexpected code execution even though the initial output was escaped.

Fixes gh-2101
Closes gh-2102
tests/unit/checkboxradio/checkboxradio.html
tests/unit/checkboxradio/core.js
tests/unit/checkboxradio/methods.js
ui/widgets/checkboxradio.js