CVE-2020-7656: Jquery Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-q4m3-2j7h-f7xw
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2020-7656 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) 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-2020-7656 at a Glance

CVE Identifier CVE-2020-7656
GHSA Identifier GHSA-q4m3-2j7h-f7xw
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
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.1/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-2020-7656

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
jQuery fixed: 1.9.0
Upgrade jQuery to 1.9.0
jquery-rails fixed: 2.2.0
Upgrade jquery-rails to 2.2.0
org.webjars.npm:jquery fixed: 1.9.0
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>jquery</artifactId>
    <version>1.9.0</version>
</dependency>
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-2020-7656, 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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

Versions of `jquery` prior to 1.9.0 are vulnerable to Cross-Site Scripting. The load method fails to recognize and remove `<script>` HTML tags that contain a whitespace character, i.e: `</script >`, which results in the enclosed script logic to be executed. This allows attackers to execute arbitrary JavaScript in a victim's browser. ## Recommendation Upgrade to version 1.9.0 or later.

CVE-2020-7656 Affected Jquery Versions

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

References

Frequently Asked Questions

What is CVE-2020-7656?
CVE-2020-7656 is a security vulnerability in Jquery involving Cross-Site Scripting in jquery under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Jquery versions are affected?
Affected versions include releases prior to 1.9.0, 2.2.0 across affected packages: jquery, jQuery, jquery-rails, org.webjars.npm:jquery.
What version fixes CVE-2020-7656?
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-2020-7656?
CVE-2020-7656 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2020-7656?
CVE-2020-7656 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2020-7656?
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-q4m3-2j7h-f7xw",
  "modified" : "2024-10-10T16:17:32Z",
  "published" : "2020-05-20T16:18:01Z",
  "aliases" : [ "CVE-2020-7656" ],
  "summary" : "Cross-Site Scripting in jquery",
  "details" : "Versions of `jquery` prior to 1.9.0 are vulnerable to Cross-Site Scripting. The load method fails to recognize and remove `<script>` HTML tags that contain a whitespace character, i.e: `</script >`, which results in the enclosed script logic to be executed. This allows attackers to execute arbitrary JavaScript in a victim's browser.\n\n\n## Recommendation\n\nUpgrade to version 1.9.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jquery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.1"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "jQuery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.1"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "jquery-rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.webjars.npm:jquery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.1"
      }, {
        "fixed" : "1.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-7656"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jquery/jquery/commit/05531fc4080ae24070930d15ae0cea7ae056457d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jquery/jquery/commit/606b863edaff29035960e4d813b45d63b8d92876"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jquery/jquery"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jquery/jquery/blob/9e6393b0bcb52b15313f88141d0bd7dd54227426/src/ajax.js#L203"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/jquery-rails/blob/master/CHANGELOG.md#220-19-january-2013"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/jquery-rails/blob/v2.1.4/vendor/assets/javascripts/jquery.js#L7481"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/jquery-rails/CVE-2020-7656.yml"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20200528-0001"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-JQUERY-569619"
  }, {
    "type" : "WEB",
    "url" : "https://supportportal.juniper.net/s/article/2021-07-Security-Bulletin-Junos-OS-Multiple-J-Web-vulnerabilities-resolved-in-Junos-OS-21-2R1?language=en_US"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-05-20T16:17:45Z",
    "nvd_published_at" : "2020-05-19T21:15:00Z"
  }
}