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.

— Ubuntu

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

Affected Software

24 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
debian/jquery
alpine/ruby<2.5.6-r0
2.5.6-r0
All of the following
azurelinux/boost=1.83.0-2
Microsoft Azure Linux=3.0
All of the following
azurelinux/scons=4.6.0-1
Microsoft Azure Linux=3.0
All of the following
azurelinux/slf4j<2.0.7-1
2.0.7-1
Microsoft Azure Linux=3.0
All of the following
azurelinux/javapackages-bootstrap=1.14.0-2
Microsoft Azure Linux=3.0
All of the following
azurelinux/python-blinker<1.7.0-4
1.7.0-4
Microsoft Azure Linux=3.0
All of the following
azurelinux/fontawesome4-fonts=4.7.0-12
Microsoft Azure Linux=3.0
All of the following
azurelinux/ceph<18.2.2-1
18.2.2-1
Microsoft Azure Linux=3.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade nuget/jQuery to a version that resolves this vulnerability.

    Fixed in 1.9.0
  2. Upgrade

    Upgrade maven/org.webjars.npm:jquery to a version that resolves this vulnerability.

    Fixed in 1.9.0
  3. Upgrade

    Upgrade npm/jquery to a version that resolves this vulnerability.

    Fixed in 1.9.0
  4. Upgrade

    Upgrade rubygems/jquery-rails to a version that resolves this vulnerability.

    Fixed in 2.2.0
  5. Upgrade

    Upgrade alpine/ruby to a version that resolves this vulnerability.

    Fixed in 2.5.6-r0
  6. Upgrade

    Upgrade azurelinux/slf4j to a version that resolves this vulnerability.

    Fixed in 2.0.7-1
  7. Upgrade

    Upgrade azurelinux/python-blinker to a version that resolves this vulnerability.

    Fixed in 1.7.0-4
  8. Upgrade

    Upgrade azurelinux/ceph to a version that resolves this vulnerability.

    Fixed in 18.2.2-1
  9. Upgrade

    Upgrade jquery to a version that resolves this vulnerability.

    Fixed in 1.9.0

Event History

Jan 18, 2018
CVE Published
via Ubuntu·12:00 AM
Data Sourced
via Ubuntu·12:00 AM
RemedyDescriptionSeverityAffected Software
CVE Published
via MITRE·11:00 PM
Data Sourced
via MITRE·11:00 PM
Description
Data Sourced
11:29 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·11:29 PM
DescriptionSeverityAffected Software
Sep 1, 2020
Advisory Published
04:41 PM
May 31, 2023
Advisory Published
05:49 PM
Sep 11, 2024
Data Sourced
via Microsoft·12:00 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·12:00 AM
WeaknessAffected Software
Updated
via Microsoft·07:00 AM
SeverityWeaknessAffected Software
Jun 16, 2026
Data Sourced
via NVD·11:48 PM
RemedyDescriptionSeverityWeaknessAffected Software
Updated
via NVD·11:48 PM
RemedyAffected Software
Nov 27, 2026
Updated
via Microsoft·09:04 AM
SeverityWeakness

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