CVE-2012-6708: Jquery Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-2pqj-h3vj-pqgw
CVSS 6.1
CWE-64 CWE-79
Published
Advisory Summary

CVE-2012-6708 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-64: Windows Shortcut Following (.LNK)) affecting Jquery libraries in the npm ecosystem. The issue involves cross-site scripting in jquery. Remediation is available by upgrading affected packages to version 1.9.0, 2.2.0.

CVE-2012-6708 at a Glance

CVE Identifier CVE-2012-6708
GHSA Identifier GHSA-2pqj-h3vj-pqgw
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-64: Windows Shortcut Following (.LNK)
Affected Product Jquery
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2012-6708

To remediate this vulnerability, upgrade all affected Jquery dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jquery fixed: 1.9.0
npm install jquery@1.9.0
org.webjars.npm:jquery fixed: 1.9.0
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>jquery</artifactId>
    <version>1.9.0</version>
</dependency>
jQuery fixed: 1.9.0
Upgrade jQuery to 1.9.0
jquery-rails fixed: 2.2.0
Upgrade jquery-rails to 2.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls jquery

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2012-6708, inspect your project dependencies using npm:

npm ls jquery

Analyze the terminal output to locate any version of Jquery in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.0), your application is affected.

Note: The npm ls jquery command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-64: Windows Shortcut Following (.LNK), where the product, when opening a file or directory, does not sufficiently handle when the file is a windows shortcut (.lnk) whose target is outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. In Jquery, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2012-6708 Affected Jquery Versions

4 component(s)
Fixed Versions:
1.9.02.2.0
Product / Package Ecosystem Affected Versions Fixed Version
jquery
npm
< 1.9.0
1.9.0
org.webjars.npm:jquery
Maven
< 1.9.0
1.9.0
jQuery
NuGet
< 1.9.0
1.9.0
jquery-rails
RubyGems
< 2.2.0
2.2.0

References

NVD — CVE-2012-6708 NVD
https://nvd.nist.gov/vuln/detail/CVE-2017-16011
NVD — CVE-2012-6708 NVD
https://nvd.nist.gov/vuln/detail/CVE-2012-6708
Security Fix Commit FIX COMMIT
https://github.com/jquery/jquery/commit/05531fc4080ae24070930d15ae0cea7ae056457d
Jquery Security Information SECURITY
https://web.archive.org/web/20200227132049/http://www.securityfocus.com/bid/102792
snyk.io/vuln/npm:jquery:201... WEB
https://snyk.io/vuln/npm:jquery:20120206
Jquery Security Information SECURITY
https://security.snyk.io/vuln/SNYK-DOTNET-JQUERY-450223
research.insecurelabs.org/jquery/test WEB
https://research.insecurelabs.org/jquery/test
lists.apache.org/thread.html/f9bc3e5... WEB
https://lists.apache.org/thread.html/f9bc3e55f4e28d1dcd1a69aae6d53e609a758e34d2869b4d798e13cc@%3Cissues.drill.apache.org%3E
lists.apache.org/thread.html/b0656d3... WEB
https://lists.apache.org/thread.html/b0656d359c7d40ec9f39c8cc61bca66802ef9a2a12ee199f5b0c1442@%3Cdev.drill.apache.org%3E
lists.apache.org/thread.html/519eb0f... WEB
https://lists.apache.org/thread.html/519eb0fd45642dcecd9ff74cb3e71c20a4753f7d82e2f07864b5108f@%3Cdev.drill.apache.org%3E
Jquery Security Information SECURITY
https://help.ecostruxureit.com/display/public/UADCE725/Security+fixes+in+StruxureWare+Data+Center+Expert+v7.6.0
Jquery Source Repository REPOSITORY
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/jquery-rails/CVE-2012-6708.yml
Jquery Source Repository REPOSITORY
https://github.com/rails/jquery-rails/blob/v2.2.0/vendor/assets/javascripts/jquery.js#L67
Jquery Source Repository REPOSITORY
https://github.com/rails/jquery-rails/blob/v2.1.4/vendor/assets/javascripts/jquery.js#L59
Jquery Source Repository REPOSITORY
https://github.com/jquery/jquery
Jquery Security Information SECURITY
https://bugs.jquery.com/ticket/9521
Jquery Security Information SECURITY
https://bugs.jquery.com/ticket/6429
Jquery Security Information SECURITY
https://bugs.jquery.com/ticket/12531
Jquery Security Information SECURITY
https://bugs.jquery.com/ticket/11290
Jquery Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00041.html
Jquery Security Information SECURITY
http://packetstormsecurity.com/files/153237/RetireJS-CORS-Issue-Script-Execution.html
Jquery Security Information SECURITY
http://packetstormsecurity.com/files/161972/Linksys-EA7500-2.0.8.194281-Cross-Site-Scripting.html

Frequently Asked Questions

What is CVE-2012-6708?
CVE-2012-6708 is a security vulnerability in Jquery involving Cross-Site Scripting in jquery under CWE-64: Windows Shortcut Following (.LNK).
Which Jquery versions are affected?
Affected versions include releases prior to 1.9.0, 2.2.0 across affected packages: jquery, org.webjars.npm:jquery, jQuery, jquery-rails.
What version fixes CVE-2012-6708?
Upgrading to 1.9.0, 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jquery affected?
Yes, jquery is affected in releases prior to 1.9.0. Upgrade your dependency to 1.9.0 or later.
Is jQuery affected?
Yes, jQuery is affected in releases prior to 1.9.0. Upgrade your dependency to 1.9.0 or later.
What is the CVSS score of CVE-2012-6708?
CVE-2012-6708 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2012-6708?
CVE-2012-6708 is classified under CWE-64: Windows Shortcut Following (.LNK) (The product, when opening a file or directory, does not sufficiently handle when the file is a Windows shortcut (.LNK) whose target is outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.).
How can I check npm dependencies for CVE-2012-6708?
Run the dependency tree command: 'npm ls jquery'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2pqj-h3vj-pqgw",
  "modified" : "2023-06-26T17:03:57Z",
  "published" : "2020-09-01T16:41:46Z",
  "aliases" : [ "CVE-2012-6708" ],
  "summary" : "Cross-Site Scripting in jquery",
  "details" : "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.\n\n## Proof of Concept\n```\n$(\"#log\").html(\n    $(\"element[attribute='<img src=\\\"x\\\" onerror=\\\"alert(1)\\\" />']\").html()\n);\n```\n\n\n\n\n## Recommendation\n\nUpdate to version 1.9.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jquery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.8.3"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.webjars.npm:jquery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.8.3"
    }
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "jQuery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.8.3"
    }
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "jquery-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-16011"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-6708"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jquery/jquery/commit/05531fc4080ae24070930d15ae0cea7ae056457d"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200227132049/http://www.securityfocus.com/bid/102792"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/npm:jquery:20120206"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-DOTNET-JQUERY-450223"
  }, {
    "type" : "WEB",
    "url" : "https://research.insecurelabs.org/jquery/test"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/f9bc3e55f4e28d1dcd1a69aae6d53e609a758e34d2869b4d798e13cc@%3Cissues.drill.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/b0656d359c7d40ec9f39c8cc61bca66802ef9a2a12ee199f5b0c1442@%3Cdev.drill.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/519eb0fd45642dcecd9ff74cb3e71c20a4753f7d82e2f07864b5108f@%3Cdev.drill.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://help.ecostruxureit.com/display/public/UADCE725/Security+fixes+in+StruxureWare+Data+Center+Expert+v7.6.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/jquery-rails/CVE-2012-6708.yml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/jquery-rails/blob/v2.2.0/vendor/assets/javascripts/jquery.js#L67"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/jquery-rails/blob/v2.1.4/vendor/assets/javascripts/jquery.js#L59"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jquery/jquery"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.jquery.com/ticket/9521"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.jquery.com/ticket/6429"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.jquery.com/ticket/12531"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.jquery.com/ticket/11290"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00041.html"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/153237/RetireJS-CORS-Issue-Script-Execution.html"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/161972/Linksys-EA7500-2.0.8.194281-Cross-Site-Scripting.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-64", "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:19:31Z",
    "nvd_published_at" : "2018-01-18T23:29:00Z"
  }
}