Why vulnerable JavaScript libraries are an underrated risk
Hardly any modern website does without third-party libraries. They provide date pickers, carousels, form validation, animations and a thousand small things nobody wants to write themselves. The price of that convenience is a dependency: when a vulnerability becomes known in a library, every site that embeds it inherits the problem – with no action of its own. And the spread is enormous. 74% of all pages use jQuery, by far the most common frontend library (Web Almanac 2024).
The real problem is not the usage but the version state. Of the jQuery versions in use, 92.5% carry at least one known vulnerability (Web Almanac 2024). Put differently: anyone using jQuery is highly likely to run a version for which a publicly documented flaw exists. Across all libraries, 77% of websites ship at least one vulnerable component (HTTP Archive, Web Almanac 2024) – the clean page is now the exception, not the burdened one.
That this turns into real attacks is shown by the shift in entry vectors. Exploitation of known vulnerabilities as an entry vector has nearly tripled recently – a 180% increase over the previous year (Verizon DBIR 2024). Attackers do not need to find a new flaw when tens of thousands of pages carry a long-fixed one. The public documentation that helps defenders is at the same time the attacker's map.
A known vulnerability is a publicly registered security flaw, usually with a CVE identifier (Common Vulnerabilities and Exposures) and a severity rating under CVSS. Public means: the details, the affected versions and often an example exploit are freely available. In mid-2026 the European Vulnerability Database and the US NVD each hold around 366,000 CVE entries (NIST, National Vulnerability Database, as of 15 July 2026). So a 'known' flaw is not the more harmless one but the documented one – for the other side too.
How a library turns into a vulnerability
The lifecycle is the same for almost every library. At the time of integration, the chosen version is current and considered clean. Months or years later a security researcher finds a flaw, reports it responsibly, the project ships a fix in a new version – and retroactively assigns a CVE identifier for all affected older states. From that moment on, every page still loading the old version is publicly flagged as vulnerable, without anything about it having changed.
jQuery is the textbook example. Versions from 1.2 up to before 3.5.0 are prone to cross-site scripting; the jQuery project closed the flaws with version 3.5.0 in April 2020 (jQuery project; MITRE, CVE-2020-11022 and CVE-2020-11023). The associated vulnerability CVE-2020-11023 is rated medium with a CVSS base score of 6.1 (NIST, National Vulnerability Database) – not dramatic on paper, but enough to inject foreign script into a page in a vulnerable environment. Anyone shipping jQuery 1.12.4 today is doing so roughly six years after the fix.
Bootstrap shows the same pattern. Versions before 3.4.1 and before 4.3.1 carry an XSS flaw in tooltip and popover (MITRE, CVE-2019-8331). Here too the fix has been available for years – the site notices nothing as long as nobody checks the version. The overview below sets four widely used legacy versions against their fixed state.
| Library | Common legacy version | Known vulnerability | Fixed in | Current |
|---|---|---|---|---|
| jQuery | 1.12.4 | CVE-2020-11022 / -11023 (XSS) | 3.5.0 | 3.7.1 |
| Bootstrap | 3.3.7 | CVE-2019-8331 (XSS in tooltip/popover) | 3.4.1 / 4.3.1 | 5.3.3 |
| Lodash | 4.17.11 | CVE-2021-23337 (command injection) | 4.17.21 | 4.17.21 |
| Moment.js | 2.18.1 | CVE-2022-31129 (ReDoS) | 2.29.4 | 2.30.1 |
The identifiers and version details come from the CVE Program and the NVD's product mapping (MITRE, CVE Program; NIST, National Vulnerability Database). Striking is the time gap: years lie between the fixed state and what many sites actually ship. That gap is exactly where the risk lives – not because the libraries are poorly maintained, but because the update on the website never happens.
Why outdated frontend libraries survive for so long
If fixes have been available for years, why do so many sites run outdated libraries? The reasons are rarely negligence, mostly structure.
- No inventory. Hardly anyone keeps a list of which library runs in which version on the site. What is not recorded does not get updated. That jQuery still sits on 74% of pages (Web Almanac 2024) shows how deeply such dependencies are embedded.
- Themes and templates bring their own version. A purchased CMS theme or a page builder often bundles a fixed, older library version. A theme update is postponed because it would overwrite customisations – and the library stays frozen along with the theme.
- Fear of breaking changes. A jump from jQuery 1.x to 3.x or from Bootstrap 3 to 5 can change visible behaviour. Without test coverage the update seems riskier than keeping the known flaw – a misjudgement that only bites in the event of damage.
- Externally loaded scripts. Some libraries come not from your own directory but from a third-party endpoint. They appear in no server package list and therefore stay invisible in classic inventories.
- Responsibility without ownership. In agency projects the maintenance contract ends, the site keeps running. Nobody feels responsible for the library version until an incident raises the question.
An old library is not automatically dangerous – what is dangerous is running it without knowing. Once you have recorded that a specific version is in use, you can decide deliberately: update, mitigate, or carry the residual risk with documentation. Without that knowledge the decision falls silently against security, every single day.
The attack path: from known flaw to compromised site
The path from flaw to damage is short for frontend libraries. Many of the most common vulnerabilities are XSS flaws: under certain conditions they allow foreign JavaScript to be injected into the page. Once that succeeds, the foreign code runs with the page's privileges – it can read form input, harvest session data or redirect visitors unnoticed. That 92.5% of jQuery versions in the field carry a known flaw (Web Almanac 2024) shows how broad this attack surface is.
It becomes especially delicate when the compromised library sits in sensitive places – near payment or login forms, for instance. Injected script can exfiltrate input there to a foreign endpoint. How such an unwanted data flow to third parties can even be measured is covered in the article on data outflow to third countries on websites. Two proven layers limit the damage further: a Content Security Policy that blocks foreign script sources and Subresource Integrity that detects altered files by their hash.
A vulnerable library is your own code with a known flaw – it has a CVE identifier and is fixed by a version update. A compromised third-party script, by contrast, is foreign code that was altered after the fact; it carries no CVE and only shows up through an integrity check. Both risks converge in the same frontend but need different detection. That is why version detection and script integrity belong side by side in monitoring.
Detecting libraries and versions reliably
The first step against vulnerable libraries is no grand initiative but simply this: look. A security scan renders the page in a real browser, identifies the loaded libraries and their versions, and matches those against public vulnerability data. The result is a list like the mockup above: library, current version, recommended target version, assigned CVE and a traffic-light status.
What matters is that detection happens in the real rendering, not only in the served HTML. Some libraries only appear at runtime – loaded dynamically, from within a theme, or from an external endpoint. Only by seeing what the browser actually executes do you capture those components too. Four layers belong in robust detection.
Recognise the name of the embedded library – even when the file has been renamed, bundled or minified. A fingerprint in the code is more reliable than the file name.
The exact version number is the linchpin. The major version is not enough – whether a flaw applies often comes down to the patch level, for example 3.4.1 versus 3.4.0.
Check the detected version against registered vulnerabilities and assign the corresponding CVE and its severity. That turns a version number into a concrete, prioritisable task.
A one-off snapshot ages with the next deploy. Only recurring checks keep detection current and catch newly added or newly disclosed flaws.
Beyond version detection, it is worth looking at the integrity of the embedded scripts. While the security scan asks whether a library has a known flaw, script integrity monitoring asks whether an embedded file was altered unnoticed. Together the two cover both the known and the freshly manipulated risk.
From scan report to priority: which flaw first
A scan report is only the start. If it finds four vulnerable libraries, that does not mean updating all of them tonight. A short order of work, driven by exploitability and exposure rather than the CVSS score alone, is more useful.
- Actively exploited first. If one of your versions is tied to a flaw considered actively exploited, it takes priority. In the European Vulnerability Database only around 1,650 entries are flagged as actively exploited (ENISA, European Vulnerability Database, as of 15 July 2026) – a small, manageable set to start with.
- Exposed locations next. A library near login, payment or form pages weighs more than the same flaw on a static subpage. The question is: what could an attacker concretely achieve at this point?
- Severity to sort, not as the first filter. The CVSS score helps to order within a group. As the sole criterion it misleads, because it does not reflect actual exploitation.
- The rest in the cycle. Whatever is neither exploited nor exposed moves into the regular update rhythm – documented, so the decision stays traceable.
How to derive this order cleanly from public feeds, and why 'actively exploited' outweighs a high score, is explored in the article on the EUVD, CVE, NVD and KEV vulnerability feeds. For day-to-day work the simple rule of thumb suffices: the demonstrably exploited first, then the exposed, then the rest.
Securing detection after every deploy
A one-off scan says how the site looks today. But libraries come and go with every release: a new plugin brings an old jQuery version, a theme update swaps a file, a developer quickly embeds an external library for a feature. That is why detection belongs not in an annual audit but in ongoing monitoring – ideally after every deploy. That exploitation of known flaws as an entry vector has risen by 180% (Verizon DBIR 2024) makes this continuity basic hygiene.
If a deploy worsens the state – a new vulnerable version appears – that should not go unnoticed for weeks. A regression alert through the configured notification channels reports the new arrival while the link to the last release is still fresh. The same deploy logic applies to neighbouring risks – an accidentally set noindex after a deploy, for instance, which a release quietly brings along and which costs search visibility.
For completeness, the library question belongs in a larger component picture. The CRA component cockpit inventories CMS, extensions, frontend libraries and server software per website and records the version state. As a side benefit, current, lean libraries also ease the transfer weight – how much outdated dependencies bloat a page is shown in the article on page weight and resource bloat.
Getting started in practice needs no grand preparation: scan a single website, look at the library list, classify the first vulnerable version. You will very likely find the list is manageable and the urgent cases can be counted on one hand. The interplay of scan, prioritisation and alert is shown in the live demo; which feature is included in which plan is set out in the pricing overview. An invisible standing risk thus becomes a deliberate, recurring decision.
This article draws on data and documents from: Web Almanac 2024 (HTTP Archive) – chapters on JavaScript and security: 77% of websites with at least one JavaScript library carrying a known vulnerability, jQuery on 74% of pages, 92.5% of jQuery versions in use with known flaws; Verizon Data Breach Investigations Report 2024 – roughly 180% increase in exploitation of vulnerabilities as an entry vector; MITRE – CVE Program (CVE-2020-11022 and CVE-2020-11023 for jQuery, CVE-2019-8331 for Bootstrap, CVE-2021-23337 for Lodash, CVE-2022-31129 for Moment.js); NIST – National Vulnerability Database (CVSS rating of CVE-2020-11023 at 6.1; around 366,000 CVE entries, as of 15 July 2026); ENISA – European Vulnerability Database (around 1,650 entries flagged as actively exploited, as of 15 July 2026); jQuery project (fix of the XSS flaws with version 3.5.0 in April 2020). Library version details refer to the projects' respective documented release states.