First published: Thu Jan 18 2018(Updated: )
Affected versions of `jquery` are vulnerable to cross-site scripting. This occurs because the main `jquery` function uses a regular expression to differentiate between HTML and selectors, but does not properly anchor the regular expression. The result is that `jquery` may interpret HTML as selectors when given certain inputs, allowing for client side code execution. ## Proof of Concept ``` $("#log").html( $("element[attribute='<img src=\"x\" onerror=\"alert(1)\" />']").html() ); ``` ## Recommendation Update to version 1.9.0 or later.
Credit: cve@mitre.org cve@mitre.org
Affected Software | Affected Version | How to fix |
---|---|---|
Jquery Jquery | <1.9.0 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2012-6708 is a vulnerability in jQuery before version 1.9.0 that allows for Cross-site Scripting (XSS) attacks.
In vulnerable versions of jQuery, the jQuery(strInput) function does not differentiate selectors from HTML reliably, allowing for XSS attacks.
CVE-2012-6708 has a severity rating of 6.1 (Medium).
Versions of jQuery from 1.7.1 to 1.8.3 are affected by CVE-2012-6708.
To fix CVE-2012-6708, update jQuery to version 1.9.0 or later.