Menus and sliders on corporate sites, input helpers on contact forms, WordPress themes and plugins. jQuery tends to stay around longest on sites with no plans to be rebuilt. On November 17, the 3.x series used on such sites got its first new release in three years.
On the same day, jQuery released 3.8.0 on the 3.x series and 4.1.0 on the 4.x series. According to npm, the previous 3.x release was 3.7.1 on August 28, 2023. Both include a fix for an issue where parsing a selector string hangs processing for a long time. No advisory (GHSA or CVE) has been issued for this fix. As of November 30, the only security advisories in the jquery/jquery repository are two from 2020, and neither GitHub's advisory database nor npm's advisory lookup has an advisory that applies to 3.7.1. npm audit will not catch it.
In this article, based on the announcement on the jQuery blog, the repository's change history, and measurements from running 3.7.1, 3.8.0, 4.0.0 and 4.1.0 in a test environment, we summarize what was fixed, which sites should consider updating, and what to check before upgrading.
What 3.8.0 and 4.1.0 fixed
jQuery's 3.x series is built from the 3.x-stable branch, and the 4.x series from the main branch. Excluding build-only and test-only changes, the main fixes in the change history up to November 17 are as follows.
| Fix | 3.8.0 | 4.1.0 |
|---|---|---|
| Fixed an issue where parsing selector identifiers took exponentially longer (ReDoS) (March 30) | Included | Included |
Worked around an issue where jQuery.escapeSelector() returned incorrect results on Safari 27 (September 30) | Included | Included |
| Fixed the regular expression used for unescaping in the same way (August 31) | Included | Included |
| Added a way to pass the completion call of an Ajax transport as a single object | Included | Included |
Changes only in 4.x, such as adding responseURL to jqXHR | — | Included |
Between 3.7.1 and 3.8.0, changes from 2024 to 2025 are also included: a change that formally deprecated push, sort and splice (April 2025), and a change that deprecated jQuery.expr[":"] and jQuery.expr.filters (November 2024). In both cases the functionality still works, and jQuery Migrate will warn about them if it is loaded.
The announcement on the jQuery blog (November 17) describes 3.8.0 as a send-off, not a comeback. 3.8.0 is the last planned feature update for the 3.x series, and from now on 3.x will receive only critical security fixes and bug fixes. The announcement recommends that users who have not yet moved to 4.x do so.
The npm publishing settings also changed. With a change on November 17, 3.x releases are published under the v3-latest tag instead of latest. As of November 30, npm install jquery installs 4.1.0, and the latest 3.x release is installed by specifying npm install jquery@3 or jquery@3.8.0.
Invalid selectors hang processing
The fix commit (March 30, Selector: Fix ReDoS in identifier matching) explains the problem as follows: when a long run of hexadecimal escapes ends with an invalid character, regular expression backtracking grows explosively. The added test uses an attribute selector [\a\a…\a!] with 30 repetitions of \a ending in !, and notes that the browser could hang for more than a minute.
In the 3.8.0 source, jQuery first passes the selector to the browser's querySelectorAll, and falls back to its own parser (select()) when an exception is thrown. Because querySelectorAll throws an exception for invalid selectors, processing reaches jQuery's own parser.
So we passed selectors of the same form to jQuery's own parsing function (jQuery.find.tokenize), varied the number of \a, and measured the time. These are single measurements on Node.js v22.23.5 and jsdom 26.1.0.

On 3.7.1 and 4.0.0, it took about 29 milliseconds with 20 \a, about 2 seconds with 26, and about 30 seconds with 30. Each increase of two roughly quadruples the time. On 3.8.0 and 4.1.0, it took less than 1 millisecond even with 40. 4.0.0 (January 18) is also a pre-fix release, so sites using 4.x also need to upgrade to 4.1.0.
Note that jsdom's querySelectorAll took about 240 milliseconds with 22 repetitions of the same selector. If you use jsdom in your test environment, this time remains even after upgrading jQuery. We have not checked the time taken by the browser's querySelectorAll.
Which sites are affected
The slowdown only happens when the selector string is invalid. It does not happen with fixed selectors written by the site's developers. What can be affected is code that builds selectors from strings coming from outside (editorial summary).
- Using the URL hash directly as a selector, as in
$(location.hash)(tabs or accordions opened by in-page links) - Building selectors from query strings or form input, as in
$('[data-id="' + value + '"]') - Using values from received JSON in selectors
Because jQuery runs in the browser, what hangs is the tab of the visitor who processed that selector, not the server. However, if someone is tricked into opening a crafted URL, that page freezes and becomes unusable (editorial summary).
When putting values from outside into a selector, the reliable approach, regardless of version, is to pass them through $.escapeSelector() or replace the code with a method that does not use selectors, such as document.getElementById(). The Safari 27 issue is a problem where this escapeSelector() regular expression matches at the wrong position because of a bug in Safari 27, and it is worked around in 3.8.0 and 4.1.0 (we have not checked the behavior in Safari).
WordPress bundles 3.7.1
WordPress bundles jQuery in its core. In WordPress 7.1.5 from November 18, wp-includes/script-loader.php registers jquery-core as 3.7.1 and jquery-migrate as 3.4.1. In 7.2, scheduled for release on December 8 (the 7.2 branch is at RC3 as of November 30), and in the development version (trunk of wordpress-develop), jquery-core also remains at 3.7.1. Only jquery-migrate has been raised to 3.6.0.
The WordPress core team's blog (Make WordPress Core, Preparing for jQuery 4 with WordPress 7.2 from November 17) describes the plans as follows.
- In 7.2, jQuery Migrate will be raised to 3.6.0 so that it can warn about features that will no longer work in 4.x. 7.2 does not include jQuery 4
- Upgrading jQuery and jQuery Migrate to the latest versions is planned for 7.3 (a tentative plan that depends on test results)
- Stopping jQuery Migrate from loading by default is planned for the end of 2027 (7.5 or 7.6)
This bundled version is what themes and plugins load with wp_enqueue_script( 'jquery' ). The version bundled with WordPress is expected to move to 4.x in 7.3 without going through 3.8.0 (the editors' reading of the plans above). If you want the fix while staying on 3.x until then, you will need to replace it on each site. We covered what to check when updating WordPress in our article on WordPress 7.1.5.
To replace it, override the registration from a theme or plugin without modifying core files (example by the editors; not tested on WordPress).
add_action( 'wp_enqueue_scripts', function () {
wp_deregister_script( 'jquery-core' );
wp_register_script(
'jquery-core',
get_theme_file_uri( 'assets/js/jquery-3.8.0.min.js' ),
array(),
'3.8.0'
);
}, 1 );
This example only affects wp_enqueue_scripts (the public-facing pages), and does not replace what is loaded in the admin screens. Some plugins assume the bundled version. If you replace it, check every screen that uses jQuery, such as forms, sliders and pop-ups.
What to check before upgrading (editorial proposal)
- Check the version in use. Run
jQuery.fn.jqueryin the browser's developer tools to see the version. Also check that a jQuery added separately by the theme and the one bundled with WordPress are not both being loaded - Decide whether to upgrade within 3.x or move to 4.x. 3.8.0 is an update within the 3.x series. 4.x is a major version update, so plan the migration as a separate task. Since jQuery limits future 3.x fixes to critical ones and WordPress plans to move to the latest version in 7.3, treat 3.8.0 as a stopgap until you move to 4.x (editorial suggestion). We covered how to decide whether to keep jQuery in our article on sites that still use jQuery
- Find places where values from outside are put into selectors. Use the following expression to list candidates, and check them one by one
grep -rnE '\$\((location\.hash|window\.location|decodeURIComponent)|\$\([^)]*\+ *[a-zA-Z_]' --include='*.js' --include='*.php' wp-content/themes/ wp-content/plugins/
- Check warnings with jQuery Migrate. Loading the uncompressed version of jQuery Migrate in a development environment shows deprecated calls in the console. Look for code that uses
push,sortandsplice, which were deprecated in 3.8.0, orjQuery.expr[":"]. Warnings forpush,sortandspliceappear starting in jQuery Migrate 3.6.0 (confirmed in the package source). They do not appear in 3.4.1, which WordPress 7.1.5 bundles, so if you want to check without waiting for 7.2, load 3.6.0 - Check the screens and publish. If you load jQuery from a CDN, change the version in the URL to 3.8.0. Depending on your cache settings, old files may remain, so check the version after publishing
Scope of verification
On November 29, 2026, we reviewed the change history of the jquery/jquery repository (the
3.x-stableandmainbranches and tags 3.7.1, 3.8.0, 4.0.0 and 4.1.0), the descriptions, diffs and tests of the fix commits (dd23807d, 8df0f0d6, c4a98588, b61c179a, 50d9a8dc and 5eab9df7), the npm publication times, tags and advisory lookup results, andpackage.jsonandscript-loader.phpin tag 7.1.5 and trunk of WordPress/wordpress-develop (document research). On the same day, we installed jQuery 3.7.1, 3.8.0, 4.0.0 and 4.1.0 on Node.js v22.23.5 and jsdom 26.1.0 and measured the selector parsing time once for each (hands-on testing; the scripts and output are saved in the article's evidence records). On November 30, we reviewed the announcement on the jQuery blog (November 17), the security advisories in the jquery/jquery repository and GitHub's advisory database, npm's advisory lookup, the change history of 3.x-stable and main since November 17, the source of jquery-migrate 3.4.1 and 3.6.0 on npm, the Make WordPress Core announcement (Preparing for jQuery 4 with WordPress 7.2) along with the 7.2 schedule and Field Guide, and the 7.2 branch of wordpress-develop (document research). We have not tested the time in an actual browser, the Safari 27 bug, replacing jQuery in WordPress, or jQuery Migrate warnings.
We also covered updating frontend components to fixed versions in our article on XSS via attribute names in Vue SSR.
For updating sites that use jQuery, maintaining WordPress themes and plugins, or deciding whether to rebuild, please contact us through consultation on development, AI, and automation.
References
- jQuery 4.1.0 and 3.8.0 Released: Passing the Torch (jQuery blog, November 17)
- jquery/jquery — Selector: Fix ReDoS in identifier matching (3.x commit dd23807d)
- jquery/jquery — Selector: Work around a Safari 27 regex interepreter bug (3.x commit 8df0f0d6)
- jquery/jquery — Selector: Fix the runescape regex in unescapeSelector (3.x commit c4a98588)
- jquery/jquery — Release: Keep 3.x releases off the latest tags (commit b61c179a)
- jquery/jquery — Core: Formally deprecate push/sort/splice (commit 50d9a8dc)
- jquery/jquery — Selector: Properly deprecate jQuery.expr[ ”:” ]/jQuery.expr.filters (commit 5eab9df7)
- jquery/jquery — List of commits on 3.x-stable
- jquery (npm page)
- Preparing for jQuery 4 with WordPress 7.2 (Make WordPress Core, November 17)
- WordPress 7.2 schedule (Make WordPress Core)
- WordPress/wordpress-develop — src/wp-includes/script-loader.php (7.1.5 tag)









