CVE-2020-23064: jQuery Cross Site Scripting vulnerability

jquery Updated 02 Oct 2025

Summary

26/06/2023
MODERATE
Yes i
Moderate
6.1

GHSA-257q-pv89-v3xv: Duplicate Advisory: jQuery Cross Site Scripting vulnerability. Affects jquery versions >= 1.0.3, < 3.5.0. Fixed in 3.5.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

jQuery is a popular JavaScript library that simplifies HTML document traversal, event handling, and animation for web development. It is widely used to enhance the functionality and user experience of websites. However, versions 2.2.0 to 3.5.0 of jQuery are susceptible to a Cross Site Scripting (XSS) vulnerability. This vulnerability allows remote attackers to execute arbitrary code by exploiting the <options> element.

Vulnerability Detail

The jQuery XSS vulnerability (CVE-2020-23064) arises due to inadequate input sanitization in the .htmlPrefilter function. This function is responsible for processing HTML strings before they are inserted into the DOM. By crafting malicious input, an attacker can inject arbitrary JavaScript code into a web page, potentially leading to session hijacking, data theft, or other malicious activities. The severity of this vulnerability is rated as MODERATE with a CVSS score of 6.1.

How To Fix

Latest published version: 4.0.0 as of 23 Oct 2026

npm install jquery@4.0.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.5.0

This is the first release that contains the fix.

npm install jquery@3.5.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version of jQuery is not feasible immediately, developers can implement a workaround by manually sanitizing user input before using it in jQuery functions. This can be achieved by using a library or custom code that escapes special characters and removes potentially dangerous HTML tags. Here is an example of a JavaScript function that sanitizes user input:

function sanitizeInput(input) {
  return input.replace(/[&<>"'\/]/g, function (char) {
    return {
      '&': '&amp;',
      '<': '&lt;',
      '>': '&gt;',
      '"': '&quot;',
      '\'': '&#x27;',
      '/': '&#x2F;'
    }[char];
  });
}

By using this function to sanitize user input before passing it to jQuery functions, the risk of XSS attacks can be mitigated.

Conclusion

The jQuery Cross Site Scripting vulnerability (CVE-2020-23064) poses a moderate risk to web applications using affected versions of jQuery. To mitigate this vulnerability, it is crucial to upgrade to jQuery version 3.5.0 or higher and ensure proper input sanitization. Developers should also stay informed about security updates and best practices to protect their applications from potential XSS attacks. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for jquery →

Share this vulnerability

FAQ

The vulnerability allows attackers to execute arbitrary code on a web page, potentially leading to session hijacking, data theft, or other malicious activities.

Versions 2.2.0 to 3.5.0 of jQuery are affected by this vulnerability.

Yes, there are known exploits for this vulnerability. Attackers can craft malicious input to inject arbitrary JavaScript code into vulnerable web pages.

Yes, the vulnerability has been fixed in jQuery version 3.5.0. It is recommended to upgrade to this version or higher to mitigate the risk.

Yes, developers can implement a workaround by manually sanitizing user input before using it in jQuery functions. This involves escaping special characters and removing potentially dangerous HTML tags.

Related vulnerabilities

Recent vulnerabilities recorded for jquery.

How To Fix

Latest published version: 4.0.0 as of 23 Oct 2026

npm install jquery@4.0.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.5.0

This is the first release that contains the fix.

npm install jquery@3.5.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback