|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'CVE-2022-31160 (jquery-ui-rails): jQuery UI vulnerable to XSS when refreshing |
| 4 | + a checkboxradio with an HTML-like initial text label' |
| 5 | +comments: false |
| 6 | +categories: |
| 7 | +- jquery-ui-rails |
| 8 | +advisory: |
| 9 | + gem: jquery-ui-rails |
| 10 | + cve: 2022-31160 |
| 11 | + ghsa: h6gj-6jjq-h8g9 |
| 12 | + url: https://github.com/jquery/jquery-ui/security/advisories/GHSA-h6gj-6jjq-h8g9 |
| 13 | + title: jQuery UI vulnerable to XSS when refreshing a checkboxradio with an HTML-like |
| 14 | + initial text label |
| 15 | + date: 2022-07-15 |
| 16 | + description: "### Impact\nInitializing a checkboxradio widget on an input enclosed |
| 17 | + within a label makes\nthat parent label contents considered as the input label. |
| 18 | + If you call\n`.checkboxradio( \"refresh\" )` on such a widget and the initial |
| 19 | + HTML contained\nencoded HTML entities, they will erroneously get decoded. This |
| 20 | + can lead to\npotentially executing JavaScript code.\n\nFor example, starting with |
| 21 | + the following initial secure HTML:\n\n```html\n<label>\n\t<input id=\"test-input\">\n\t<img |
| 22 | + src=x onerror=\"alert(1)\">\n</label>\n```\n\nand calling:\n\n```javascript\n$( |
| 23 | + \"#test-input\" ).checkboxradio();\n$( \"#test-input\" ).checkboxradio( \"refresh\" |
| 24 | + );\n```\n\nwill turn the initial HTML into:\n\n```html\n<label>\n\t<!-- some jQuery |
| 25 | + UI elements -->\n\t<input id=\"test-input\">\n\t<img src=x onerror=\"alert(1)\">\n</label>\n```\n\nand |
| 26 | + the alert will get executed.\n\n### Patches\nThe bug has been patched in jQuery |
| 27 | + UI 1.13.2.\n\n### Workarounds\nTo remediate the issue, if you can change the initial |
| 28 | + HTML, you can wrap all\nthe non-input contents of the `label` in a `span`:\n\n```html\n<label>\n\t<input |
| 29 | + id=\"test-input\">\n\t<span><img src=x onerror=\"alert(1)\"></span>\n</label>\n```\n\n### |
| 30 | + References\nhttps://blog.jqueryui.com/2022/07/jquery-ui-1-13-2-released/\n\n### |
| 31 | + For more information\nIf you have any questions or comments about this advisory, |
| 32 | + search for a\nrelevant issue in [the jQuery UI repo](https://github.com/jquery/jquery-ui/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc).\nIf |
| 33 | + you don't find an answer, open a new issue.\n" |
| 34 | + cvss_v3: 6.1 |
| 35 | + patched_versions: |
| 36 | + - ">= 7.0.0" |
| 37 | + related: |
| 38 | + url: |
| 39 | + - https://github.com/jquery/jquery-ui/security/advisories/GHSA-h6gj-6jjq-h8g9 |
| 40 | + - https://nvd.nist.gov/vuln/detail/CVE-2022-31160 |
| 41 | + - https://github.com/advisories/GHSA-h6gj-6jjq-h8g9#:~:text=https%3A//nvd.nist,12/msg00015.html |
| 42 | + - https://blog.jqueryui.com/2022/07/jquery-ui-1-13-2-released/ |
| 43 | + - https://www.drupal.org/sa-contrib-2022-052 |
| 44 | + - https://security.netapp.com/advisory/ntap-20220909-0007/ |
| 45 | + - https://lists.fedoraproject.org/archives/list/[email protected]/message/6XBR3G3JR5ZIOJDO4224M3INXDS2VFDD/ |
| 46 | + - https://lists.fedoraproject.org/archives/list/[email protected]/message/J5LGNTICB5BRFAG3DHVVELS6H3CZSQMO/ |
| 47 | + - https://lists.fedoraproject.org/archives/list/[email protected]/message/QB2FJQXCNHO32VGVOC6DY6IPGVE4VDU6/ |
| 48 | + - https://lists.debian.org/debian-lts-announce/2022/12/msg00015.html |
| 49 | +--- |
0 commit comments