CVE-2012-6708: XSS

Published 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.

Other sources

jQuery before 1.9.0 is vulnerable to Cross-site Scripting (XSS) attacks. The jQuery(strInput) function does not differentiate selectors from HTML in a reliable fashion. In vulnerable versions jQuery determined whether the input was HTML by looking for the '<' character anywhere in the string giving attackers more flexibility when attempting to construct a malicious payload. In fixed versions jQuery only deems the input to be HTML if it explicitly starts with the '<' character limiting exploitability only to attackers who can control the beginning of a string which is far less common.

Microsoft

jQuery before 1.9.0 is vulnerable to Cross-site Scripting (XSS) attacks. The jQuery(strInput) function does not differentiate selectors from HTML in a reliable fashion. In vulnerable versions, jQuery determined whether the input was HTML by looking for the '<' character anywhere in the string, giving attackers more flexibility when attempting to construct a malicious payload. In fixed versions, jQuery only deems the input to be HTML if it explicitly starts with the '<' character, limiting exploitability only to attackers who can control the beginning of a string, which is far less common.

MITRE

Affected Software

17 affected componentsFixes available
nuget/jQuery>=1.7.1<=1.8.3
1.9.0
maven/org.webjars.npm:jquery>=1.7.1<=1.8.3
1.9.0
npm/jquery>=1.7.1<=1.8.3
1.9.0
rubygems/jquery-rails<2.2.0
2.2.0
nuget/jQuery<=1.8.3
1.9.0
maven/org.webjars.npm:jquery<=1.8.3
1.9.0
npm/jquery<=1.8.3
1.9.0
jQuery JQuery<1.9.0
Microsoft azl3 ceph 18.2.2-8
Microsoft azl3 slf4j 1.7.30-6
Microsoft azl3 ceph 18.2.2-1
Microsoft azl3 slf4j 2.0.7-1
Microsoft azl3 fontawesome4-fonts 4.7.0-12
Microsoft azl3 python-blinker 1.7.0-4
Microsoft azl3 scons 4.6.0-1
Microsoft azl3 boost 1.83.0-2
Microsoft azl3 javapackages-bootstrap 1.14.0-2

Event History

Jan 18, 2018
CVE Published
via MITRE·11:00 PM
Data Sourced
via MITRE·11:00 PM
Description
Sep 1, 2020
Advisory Published
04:41 PM
Sep 11, 2024
Data Sourced
via Microsoft·12:00 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·12:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
SeverityAffected Software
Updated
via Microsoft·07:00 AM
Description

Frequently Asked Questions

1

What is CVE-2012-6708?

CVE-2012-6708 is a vulnerability in jQuery before version 1.9.0 that allows for Cross-site Scripting (XSS) attacks.

2

How does CVE-2012-6708 work?

In vulnerable versions of jQuery, the jQuery(strInput) function does not differentiate selectors from HTML reliably, allowing for XSS attacks.

3

What is the severity of CVE-2012-6708?

CVE-2012-6708 has a severity rating of 6.1 (Medium).

4

Which versions of jQuery are affected by CVE-2012-6708?

Versions of jQuery from 1.7.1 to 1.8.3 are affected by CVE-2012-6708.

5

How can I fix CVE-2012-6708?

To fix CVE-2012-6708, update jQuery to version 1.9.0 or later.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203