{"id":"CVE-2022-31160","aliases":["GHSA-h6gj-6jjq-h8g9"],"url":"https://o3.security/vulnerability/CVE-2022-31160","summary":"jQuery UI contains potential XSS vulnerability when refreshing a checkboxradio with an HTML-like initial text label","details":"### Impact\nInitializing a checkboxradio widget on an input enclosed within a label makes that parent label contents considered as the input label. If you call `.checkboxradio( \"refresh\" )` on such a widget and the initial HTML contained encoded HTML entities, they will erroneously get decoded. This can lead to potentially executing JavaScript code.\n\nFor example, starting with the following initial secure HTML:\n```html\n<label>\n\t<input id=\"test-input\">\n\t&lt;img src=x onerror=\"alert(1)\"&gt;\n</label>\n```\nand calling:\n```js\n$( \"#test-input\" ).checkboxradio();\n$( \"#test-input\" ).checkboxradio( \"refresh\" );\n```\nwill turn the initial HTML into:\n```html\n<label>\n\t<!-- some jQuery UI elements -->\n\t<input id=\"test-input\">\n\t<img src=x onerror=\"alert(1)\">\n</label>\n```\nand the alert will get executed.\n\n### Patches\nThe bug has been patched in jQuery UI 1.13.2.\n\n### Workarounds\nTo remediate the issue, if you can change the initial HTML, you can wrap all the non-input contents of the `label` in a `span`:\n```html\n<label>\n\t<input id=\"test-input\">\n\t<span>&lt;img src=x onerror=\"alert(1)\"&gt;</span>\n</label>\n```\n\n### References\nhttps://blog.jqueryui.com/2022/07/jquery-ui-1-13-2-released/\n\n### For more information\nIf you have any questions or comments about this advisory, search for a relevant issue in [the jQuery UI repo](https://github.com/jquery/jquery-ui/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc). If you don't find an answer, open a new issue.","published":"2022-07-20T00:00:00Z","modified":"2026-08-12T03:51:11.031377283Z","cvss":{"score":6.1,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":1,"affectedPackages":[{"ecosystem":"Maven","name":"org.webjars.npm:jquery-ui","fixedVersion":"1.13.2"},{"ecosystem":"npm","name":"jquery-ui","fixedVersion":"1.13.2"},{"ecosystem":"NuGet","name":"jQuery.UI.Combined","fixedVersion":"1.13.2"},{"ecosystem":"RubyGems","name":"jquery-ui-rails","fixedVersion":"8.0.0"}],"fix":{"url":"https://github.com/jquery/jquery-ui/commit/8cc5bae1caa1fcf96bf5862c5646c787020ba3f9","label":"jquery/jquery-ui@8cc5bae"},"references":[{"type":"WEB","url":"https://www.drupal.org/sa-contrib-2022-052"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31160.json"},{"type":"ADVISORY","url":"https://github.com/jquery/jquery-ui/security/advisories/GHSA-h6gj-6jjq-h8g9"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6XBR3G3JR5ZIOJDO4224M3INXDS2VFDD/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/J5LGNTICB5BRFAG3DHVVELS6H3CZSQMO/"},{"type":"ADVISORY","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QB2FJQXCNHO32VGVOC6DY6IPGVE4VDU6/"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31160"},{"type":"ADVISORY","url":"https://security.netapp.com/advisory/ntap-20220909-0007/"},{"type":"FIX","url":"https://github.com/jquery/jquery-ui/commit/8cc5bae1caa1fcf96bf5862c5646c787020ba3f9"},{"type":"ARTICLE","url":"https://blog.jqueryui.com/2022/07/jquery-ui-1-13-2-released/"},{"type":"ARTICLE","url":"https://lists.debian.org/debian-lts-announce/2022/12/msg00015.html"},{"type":"WEB","url":"https://blog.jqueryui.com/2022/07/jquery-ui-1-13-2-released"},{"type":"WEB","url":"https://github.com/jquery-ui-rails/jquery-ui-rails/blob/master/VERSIONS.md"},{"type":"WEB","url":"https://github.com/jquery-ui-rails/jquery-ui-rails/releases/tag/v8.0.0-release"},{"type":"PACKAGE","url":"https://github.com/jquery/jquery-ui"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/jquery-ui-rails/CVE-2022-31160.yml"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6XBR3G3JR5ZIOJDO4224M3INXDS2VFDD"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/J5LGNTICB5BRFAG3DHVVELS6H3CZSQMO"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QB2FJQXCNHO32VGVOC6DY6IPGVE4VDU6"},{"type":"WEB","url":"https://security.netapp.com/advisory/ntap-20220909-0007"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:11.031377283Z"}}