Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Unpatched jQuery with known CVEs: how to find and fix it

OPS-192Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

jQuery is a JavaScript library that many themes, plugins, sliders and form tools still rely on. Like any software, it gets security fixes. Versions that are no longer updated have CVEs: public, numbered records of known vulnerabilities (for example CVE-2020-11022 and CVE-2020-11023, fixed in jQuery 3.5.0, which concern HTML handling that can lead to XSS).

Why it costs you leads or sales

An XSS flaw lets an attacker run their own script on your page. On a lead form or checkout that script can read what visitors type, redirect them, or inject fake fields. The damage is lost trust, data exposure, browser or Google Safe Browsing warnings, and possible ad account suspensions if your pages are flagged as unsafe.

How an old library turns into lost leads
  1. Visitor landsPage loads an old jQuery from a theme or CDN
  2. Old jQuery runsKnown XSS pattern is exploitable
  3. Injected scriptForm data read or visitor redirected
  4. Lead or saleTrust and conversion are lost

A vulnerable script runs in the visitor's browser before the form is submitted.

How to check if your site has it

Find every jQuery version your pages load
  1. Check in the browser console

    Open your page, press F12, open the Console tab and type jQuery.fn.jquery then press Enter. It prints the version of the copy that is active, for example 1.12.4. If it says jQuery is not defined, the page does not use it.

  2. List all copies loaded

    In the Network tab, filter by JS and search for jquery. Note each file name and its source (your domain, a CDN, or a plugin folder). Two files means two copies.

  3. Run Lighthouse

    In Chrome DevTools open Lighthouse, run a Best Practices audit and look for the item about vulnerable JavaScript libraries. It lists detected library versions with known issues.

  4. Scan with Retire.js

    Retire.js is a free open-source scanner with a browser extension and a command line tool. It reports libraries with known vulnerabilities on the pages you test.

  5. Test your key pages

    Repeat for the home page, landing pages, the form page and checkout. Different templates can load different scripts.

Paste in the browser consolejavascript
console.log('Active jQuery:', window.jQuery ? jQuery.fn.jquery : 'not loaded');
console.log([...document.scripts].map(s => s.src).filter(src => /jquery/i.test(src)));

How to fix it

The target is jQuery 3.5.0 or newer, ideally the latest 3.x release. Better still, remove jQuery from pages that do not need it. Always work on a staging copy or take a backup first.

Update jQuery by platform
  1. Update core, theme and plugins

    WordPress core ships its own jQuery. Update WordPress, then your theme and plugins from Dashboard > Updates. Most old copies come from outdated plugins.

  2. Find the plugin loading the old copy

    In the Network tab, check the file path. A path such as /wp-content/plugins/name/js/jquery.min.js names the culprit. Update, replace or remove that plugin.

  3. Avoid the old 'jQuery Migrate' workaround

    Only use the jQuery Migrate script as a temporary bridge while you fix incompatible plugins, and check the console for migrate warnings to see what to replace.

Pinned jQuery 3.7.1 with Subresource Integrityhtml
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
        integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo="
        crossorigin="anonymous"></script>
Before and after patching

Before

  • jQuery 1.12.4 loaded by an old plugin
  • Two copies of jQuery on the page
  • Lighthouse lists vulnerable libraries

After

  • Single current jQuery 3.x copy, or none
  • Plugins updated or replaced
  • Forms and checkout tested and working

How to confirm it's fixed

Confirmation checklist
  • jQuery.fn.jquery in the console shows 3.5.0 or higher (or jQuery is not defined by design)
  • Network tab shows only one jQuery file
  • Lighthouse no longer lists vulnerable libraries
  • Retire.js reports no jQuery findings
  • The browser console shows no new red errors on key pages
  • Submit a test lead and confirm it arrives in your inbox and CRM
  • Walk through menus, sliders, popups and checkout up to the payment step

How to prevent it happening again

Prevention habits
  • Turn on automatic updates for plugins and themes where you can, or review updates monthly
  • Remove plugins and apps you no longer use
  • Do not paste old script snippets or CDN links from old tutorials
  • Load libraries from one place so there is a single copy to update
  • Re-run Lighthouse or Retire.js after every theme change or new plugin
  • Keep a staging site to test updates before they go live

How FunnelGuard handles this

FunnelGuard does not check JavaScript library versions or CVEs today. It is a possible future check, but it is not available now, so do not rely on it for this.

What FunnelGuard does cover nearby is the result of a bad update. A robot visitor runs your real journeys on a schedule, such as lead forms and checkouts, checks each step and the tracking hits, and confirms test leads reach the inbox and CRM. If upgrading jQuery breaks a submit button, a failure is re-checked from a second region and you get one alert with a screenshot and a likely cause. To watch for old libraries themselves, use Lighthouse, Retire.js or your platform's security scanner on a regular schedule. A free read-only website audit is also available.

Frequently asked questions

Questions people ask

How do I check which jQuery version my website uses?

Open your page, press F12, go to the Console and type jQuery.fn.jquery. It prints the active version. Also check the Network tab filtered by JS for any extra jquery files, because a page can load more than one copy.

Which jQuery version is safe to use?

Use jQuery 3.5.0 or newer, ideally the latest 3.x release. Versions before 3.5.0 have known XSS-related CVEs such as CVE-2020-11022 and CVE-2020-11023. If your pages do not need jQuery, removing it is the safest option.

Why does Lighthouse say my site uses vulnerable JavaScript libraries?

Lighthouse compares the library versions it detects with a database of known vulnerabilities. The warning usually means an old jQuery, often loaded by a plugin or a pasted script. Find the file in the Network tab and update or remove its source.

Will updating jQuery break my website?

It can. Older plugins and themes sometimes use features removed in newer versions, which can break sliders, menus or forms. Update on a staging copy, check the console for errors, and test your forms and checkout before going live.

How do I update jQuery in WordPress?

WordPress ships its own jQuery, so update WordPress core first, then your theme and plugins. If an old copy still loads, find the plugin or theme file serving it in the Network tab and update, replace or remove that plugin.

Is jQuery 1.x or 2.x still a security risk?

Yes. Both lines are no longer maintained and miss fixes made in 3.5.0 and later. Moving to a current 3.x release is the standard fix, and the jQuery Migrate plugin can help as a temporary bridge.

Does FunnelGuard detect outdated jQuery?

No. FunnelGuard does not check library versions yet, though it is a possible future check. It does run your real forms and checkouts on a schedule, so it can show you if an update breaks a journey.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.