How to fix vulnerable component jquery on Adobe Commerce (Magento)

Update jQuery to the latest stable version (3.7+) to eliminate known cross-site scripting (XSS) and prototype-pollution vulnerabilities that attackers actively exploit.

Steps for Adobe Commerce (Magento)

  1. Adobe Commerce (Magento 2) ships jQuery as a RequireJS module in 'lib/web/jquery.js'. Update Adobe Commerce to the latest patch release via Composer: run 'composer update magento/magento2-base' (or the full 'composer update') in your project root — this upgrades the bundled jQuery.
  2. For Magento Open Source, check the currently bundled jQuery version in 'lib/web/jquery.js' and compare to the current stable. If your Magento version is end-of-life, upgrading Magento itself is required.
  3. If you must patch jQuery independently (not recommended as a permanent fix), replace 'lib/web/jquery.js' and 'lib/web/jquery.min.js' with the downloaded files from jquery.com, matching the filename exactly.
  4. Check all installed extensions: in Admin → System → Web Setup Wizard (M2.3) or via Composer, review each extension's 'view/frontend/web/js/' directories for bundled jQuery copies — contact extension vendors for updates.
  5. Run 'php bin/magento setup:static-content:deploy' and 'php bin/magento cache:flush' after any file changes.
  6. Verify the fix by loading a storefront page, opening DevTools → Network, and filtering for 'jquery' to confirm the updated version is served.
Official Adobe Commerce (Magento) documentation ↗

What is vulnerable component jquery?

jQuery is a JavaScript library that most websites load to make interactive features easier to build. Like any software, older versions of jQuery contain security bugs that have been discovered and publicly documented — these are called CVEs (Common Vulnerabilities and Exposures). When your store loads an outdated jQuery version, it is shipping known security holes directly to every visitor's browser. The fix is simply to replace the old file with a current, patched version.

Outdated jQuery versions (especially anything below 3.5.0) contain confirmed XSS vulnerabilities that allow attackers to inject malicious scripts into your pages — stealing customer payment data, session cookies, or redirecting shoppers to phishing sites. This directly endangers customer trust, can result in PCI-DSS compliance failures, and may expose you to legal liability under GDPR or CCPA if customer data is compromised. Google's Safe Browsing also flags sites that serve known malicious scripts, which can trigger browser security warnings that wipe out organic traffic overnight. OWASP lists Vulnerable and Outdated Components as #6 in its Top Ten most critical web application security risks precisely because these attacks are automated, common, and easy for criminals to run at scale.

See the complete Vulnerable component jquery guide for every platform and the full background.

Not sure if your Adobe Commerce (Magento) store has this?

Run a free SEOLZ scan — we’ll find vulnerable component jquery and every other issue across your whole site.

Scan my site free

Fix vulnerable component jquery on another platform