Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLTc5bXgtODh3Ny04Zjdx

XSS Filter Bypass via Encoded URL in validator

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="jav&#x61;script:...">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.

Permalink: https://github.com/advisories/GHSA-79mx-88w7-8f7q
JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLTc5bXgtODh3Ny04Zjdx
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 6 years ago
Updated: almost 2 years ago


CVSS Score: 6.1
CVSS vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Identifiers: GHSA-79mx-88w7-8f7q, CVE-2014-9772
References: Repository: https://github.com/chriso/validator.js
Blast Radius: 34.7

Affected Packages

npm:validator
Dependent packages: 5,570
Dependent repositories: 493,728
Downloads: 52,564,043 last month
Affected Version Ranges: < 2.0.0
Fixed in: 2.0.0
All affected versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.2.8, 0.2.9, 0.3.0, 0.3.1, 0.3.2, 0.3.4, 0.3.5, 0.3.6, 0.3.7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