GitHub Advisoryadvisory · npm
GHSA-79mx-88w7-8f7q XSS Filter Bypass via Encoded URL in validator
MEDIUM
Official page ↗
- Aliases
- CVE-2014-9772
- Ecosystem
- npm
- Packages
- validator
- Severity
- Moderate
- CVSS vector
- CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2020-06-16
Affected packages
• npm validator: < 2.0.0 → fixed in 2.0.0
Description
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:
```abc```
will render as:
```abc```
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.
Related
Alias · CVE (1)
- CVE-2014-9772 The validator package before 2.0.0 for Node.js allows remote attackers to bypass the cross-site scripting (XSS) filter via hex-encoded… vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2014-9772 advisory
- https://github.com/chriso/validator.js/issues/181 web
- https://github.com/advisories/GHSA-79mx-88w7-8f7q advisory
- https://github.com/chriso/validator.js package
- https://www.npmjs.com/advisories/43 web
- http://www.openwall.com/lists/oss-security/2016/04/20/11 web
- http://www.securityfocus.com/bid/97102 web