Monitory
← All guides

Guides

How to find vulnerable JavaScript libraries

How outdated libraries expose your site, how to detect them and how to update or replace them for good.

The risk you do not see

Most websites load JavaScript libraries such as jQuery, Bootstrap, Angular or Lodash, and many keep running versions with publicly known vulnerabilities for years. Attackers know which versions are affected and scan for them. The library is often not even something you chose: it ships inside a theme or a plugin.

How to find them

Open your page source and look at the scripts it loads, or let a scanner do it. A scanner matches each script's URL, file name and content against a vulnerability database such as retire.js, and reports every version with known vulnerabilities, with their severity and advisories.

Fix them

  • Update the library to the version named in the advisory, or a later one. If your package manager bundles it, run npm update <library> and rebuild.
  • Libraries from a CDN. Change the version in the URL.
  • Libraries bundled with a theme or plugin. Update the theme or plugin. If it is abandoned, replace it.
  • Cannot update? Check whether the vulnerable feature is used on your site, and remove it if not.

Make it routine

New vulnerabilities are published every week, so a clean result today does not stay clean. The vulnerable libraries check looks at up to 20 scripts on your homepage once a day. It fails on high or critical severity vulnerabilities and warns on low or medium ones, so you learn about a risky library when it is published rather than when it is exploited.

Keep reading