CVE-2014-9772 — validator
MEDIUMCVE-2014-9772 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in validator. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for validator — see the affected versions and patch details below.
XSS Filter Bypass via Encoded URL in validator
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
validatornpmDescription
Versions of validator prior to 2.0.0 contained an xss filter method that is affected by several filter bypasses. This may result in a cross-site scripting vulnerability.
Proof of Concept
The xss() function removes the word "javascript" when contained inside an attribute.
However, it does not properly handle cases where characters have been hex-encoded.
As a result, it is possible to build an input that bypasses the filter but which the browser will accept as valid JavaScript.
For example:
<a href="javascript:...">abc</a>
will render as:
<a href="javascript:...">abc</a>
Recommendation
The package author has decided to remove the xss filter functionality in the latest version of this module. If this feature is not currently being used, you are not affected by the vulnerability. If it is being used, updating to the latest version of the module will break your application.
In order for affected users to mitigate this vulnerability, it is necessary to use an alternative package that provides similar functionality.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | validator | all versions | 2.0.0npm install validator@2.0.0 |
Affected Products
node.jsnodejsResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for validator, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update validator to 2.0.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2014-9772 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2014-9772 in your dependencies?
Find it across npm, including transitive dependencies.