CVE-2015-9251: Cross-Site Scripting (XSS) in jquery

jquery Updated 02 Oct 2025

Summary

22/01/2018
Yes i
Moderate
6.1

CVE-2015-9251: Cross-Site Scripting (XSS) in jquery. Affects jquery across 2 version ranges.

< 1.12.2 >= 1.12.3, < 3.0.0

Fixed in 1.12.2 or 3.0.0, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2015-9251 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

jQuery is a popular JavaScript library that simplifies HTML document traversal, event handling, and animation. It is widely used in web development to enhance user experience and streamline front-end development. However, versions of jQuery prior to 3.0.0 are vulnerable to a Cross-Site Scripting (XSS) attack. This vulnerability allows an attacker to inject malicious code into a web page, potentially leading to unauthorized access, data theft, or other malicious activities.

Vulnerability Detail

The vulnerability arises from the way affected versions of jQuery interpret text/javascript responses from cross-origin AJAX requests. Even when the AJAX request does not specify the dataType option, jQuery automatically executes the response contents in jQuery.globalEval. This behavior can be exploited by an attacker to execute arbitrary JavaScript code in the context of the vulnerable web page, leading to XSS attacks. The impact of this vulnerability can range from defacement of the website to stealing sensitive user information.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.12.2 1.12.2
    npm install jquery@1.12.2
  • >= 1.12.3, < 3.0.0 3.0.0
    npm install jquery@3.0.0

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If you are unable to immediately update to a fixed version of jQuery, a possible workaround is to explicitly set the dataType option to a value other than text/javascript in your AJAX requests. By specifying a different data type, such as json or html, you can prevent the automatic execution of the response contents. However, this workaround may not be foolproof and it is still recommended to update to a fixed version as soon as possible.

Conclusion

The Cross-Site Scripting (XSS) vulnerability in jQuery can have serious security implications for web applications. It is crucial to update to a fixed version of jQuery (3.0.0 or later) or apply the recommended workaround to protect your application from potential attacks. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for jquery →

Share this vulnerability

FAQ

Cross-Site Scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. This can lead to various attacks, such as stealing sensitive information, defacing websites, or redirecting users to malicious websites.

An attacker can exploit this vulnerability by crafting a malicious AJAX response with JavaScript code and tricking a user into visiting a web page that makes an AJAX request to the attacker-controlled domain. When the vulnerable web page processes the response, the malicious code will be executed in the user's browser, allowing the attacker to perform unauthorized actions.

Yes, there have been documented cases of attackers exploiting this vulnerability in the wild. It is important to update to a fixed version of jQuery or apply the recommended workaround to protect your application from potential attacks.

No, only versions of jQuery prior to 3.0.0 are affected by this vulnerability. If you are using a version 3.0.0 or later, you are not vulnerable to this specific issue.

Apart from updating jQuery to a fixed version, you can also consider implementing a Content Security Policy (CSP) for your web application. A properly configured CSP can help mitigate the impact of XSS vulnerabilities by restricting the execution of untrusted scripts.

Related vulnerabilities

Recent vulnerabilities recorded for jquery.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.12.2 1.12.2
    npm install jquery@1.12.2
  • >= 1.12.3, < 3.0.0 3.0.0
    npm install jquery@3.0.0

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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