Malicious
Code someone put there to harm your visitors. It is never fine to run, so you stop it first and ask questions after.
Vulnerable
A library with a known flaw, added in good faith. Most are fixed by an upgrade, on a schedule set by how serious the flaw is.
Why it matters
Treating every finding as urgent buries the one that is. Treating a skimmer as a ticket for next sprint gives it weeks.
What is the difference between a malicious script and a vulnerable one?
A malicious script was written or changed to do harm; a vulnerable script was written in good faith and has a flaw someone could abuse. The first is already attacking your visitors, so you stop it now. The second might be attacked one day, so you fix it on a schedule that matches how serious the flaw is and whether it can be reached on your pages.
The two problems side by side
When a script is malicious
A malicious script rarely announces itself. The file keeps its name and often its URL, and the site keeps working. What changes is what the code does: it starts reading what visitors type into payment or login fields, it talks to a server it never used before, or it hides what it does behind decoding and runtime code. Recent cases show the pattern: a trusted analytics tag that served exploits for a week (the Plerdy compromise), and a performance script that drained crypto wallets (the DebugBear incident).
- Stop it first. Block the script, its host or its vendor on the pages it reaches. A wrong block costs a broken widget for an hour; a missed skimmer costs every card typed in the meantime.
- Then find out how it got there. A vendor's file, your own bundle, a tag manager change or a plugin update each points to a different fix.
- Treat it as an incident. Follow your incident response plan, and for payment pages, your obligations to your acquirer.
When a library is vulnerable
Most sites ship a few libraries with known advisories: an older jQuery, a date picker, a carousel. That is a maintenance problem, not an attack, and the useful question is how much it matters on your pages.
- How severe is it? A critical or high advisory comes first. A low one can usually wait for the next routine upgrade.
- Can it be reached? A flaw in a function your pages never call, or on a page with no forms, matters less than one on checkout.
- Is there a fix? Most advisories are fixed by upgrading within the same major version. Where there is none, replace the library or limit what it can do.
- Write the decision down. If you keep a vulnerable version for a while, record why and until when. That record is what an assessor asks for.
What PCI DSS 6.4.3 & 11.6.1 expect
For payment pages, 6.4.3 asks you to authorise every script and assure its integrity, which a malicious change breaks by definition. 11.6.1 asks you to detect unauthorised changes to scripts and security-impacting headers as the browser receives them. Separately, PCI DSS asks you to manage known vulnerabilities in the software you run, which covers libraries your pages load. Two different obligations, which is one more reason to keep the two problems apart.
See every script on your checkout, with malicious behaviour and vulnerable libraries reported separately. Free on 1,000 page views a month.
How Script Monitoring tells them apart
Script Monitoring reads every script that runs on your pages. Behaviour and source decide whether it looks malicious, and AI analysis reads the code before anything alerts, so you can block it in the browser right away. Libraries are checked against known-vulnerability databases and alert by advisory and severity, so a critical CVE is not buried under minor ones. See AI script analysis and script blocking.
Sources and methodology
Requirement descriptions are paraphrased from PCI DSS v4.0.1, published by the PCI Security Standards Council. The incidents mentioned are covered in our own posts, which list their sources. Written on 10 November 2026.
Ask an AI
Don’t just take our word for it
What is the difference between a malicious script and a vulnerable JavaScript library, and how should each be handled?
Frequently asked questions
Can a vulnerable library become malicious?
Not by itself. But a flaw in a library can let an attacker run their own code on your page, and from then on it is a malicious-script problem.
Should I block every script with a CVE?
No. Blocking a library your site depends on breaks the site. Upgrade or replace it, on a schedule set by severity and exposure.
Is an obfuscated script always malicious?
No. Many vendors minify or obfuscate their code. It is a reason to look closer, not a verdict on its own.
Which comes first if I have both?
The malicious script. It is attacking now; the vulnerable library might be attacked later.