CVE-2014-9772: Validator Cross-Site Scripting Vulnerability
MODERATECVE-2014-9772 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Validator libraries in the npm ecosystem. The issue involves xss filter bypass via encoded url in validator. Remediation is available by upgrading affected packages to version 2.0.0.
CVE-2014-9772 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2014-9772
To remediate this vulnerability, upgrade all affected Validator dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install validator@2.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls validator
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2014-9772, inspect your project dependencies using npm:
npm ls validator
Analyze the terminal output to locate any version of Validator in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), your application is affected.
Note: The npm ls validator command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Validator, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2014-9772 Affected Validator Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
validator
|
npm |
< 2.0.0
|
2.0.0
|
References
Frequently Asked Questions
What is CVE-2014-9772?
Which Validator versions are affected?
What version fixes CVE-2014-9772?
Is validator affected?
What is the CVSS score of CVE-2014-9772?
What CWE is associated with CVE-2014-9772?
How can I check npm dependencies for CVE-2014-9772?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-79mx-88w7-8f7q",
"modified" : "2021-09-02T21:06:02Z",
"published" : "2018-11-06T23:12:49Z",
"aliases" : [ "CVE-2014-9772" ],
"summary" : "XSS Filter Bypass via Encoded URL in validator",
"details" : "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.\n\n\n## Proof of Concept\nThe xss() function removes the word \"javascript\" when contained inside an attribute.\n\nHowever, it does not properly handle cases where characters have been hex-encoded. \n\nAs a result, it is possible to build an input that bypasses the filter but which the browser will accept as valid JavaScript.\n\nFor example:\n```<a href=\"javascript:...\">abc</a>```\nwill render as:\n```<a href=\"javascript:...\">abc</a>```\n\n\n## Recommendation\n\nThe 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.\n\nIn order for affected users to mitigate this vulnerability, it is necessary to use an [alternative package](https://www.npmjs.com/search?q=xss%20filter&page=1&ranking=optimal) that provides similar functionality.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "validator"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2014-9772"
}, {
"type" : "WEB",
"url" : "https://github.com/chriso/validator.js/issues/181"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-79mx-88w7-8f7q"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/chriso/validator.js"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/43"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2016/04/20/11"
}, {
"type" : "WEB",
"url" : "http://www.securityfocus.com/bid/97102"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:22:15Z",
"nvd_published_at" : null
}
}