CVE-2013-7454: Validator Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-q4qq-fm7q-cwp5
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2013-7454 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 multiple xss filter bypasses in validator. Remediation is available by upgrading affected packages to version 1.1.0.

CVE-2013-7454 at a Glance

CVE Identifier CVE-2013-7454
GHSA Identifier GHSA-q4qq-fm7q-cwp5
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Validator
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2013-7454

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.

validator fixed: 1.1.0
npm install validator@1.1.0
Verify Direct and Transitive Dependencies

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-2013-7454, 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 1.1.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

Versions of `validator` prior to 1.1.0 are affected by several cross-site scripting vulnerabilities due to bypasses discovered in the blacklist-based filter. ## Proof of Concept Various inputs that could bypass the filter were discovered: Improper parsing of nested tags: ``` <s <onmouseover="alert(1)"> <;s onmouseover="alert(1)">This is a test</s> ``` Incomplete filtering of javascript: URIs: ``` <a href="javascriptJ a V a S c R iPt::alert(1)" "<s>">test</a> ``` UI Redressing: ``` <div style="z-index: 9999999; background-color: green; width: 100%; height: 100%"> <h1>You have won</h1>Please click the link and enter your login details: <a href="http://example.com/">http://good.com</a> </div> ``` Bypass via Nested Forbidden Strings: ``` <scrRedirecRedirect 302t 302ipt type="text/javascript">prompt(1);</scrRedirecRedirect 302t 302ipt> ``` Additional bypasses were discovered by Krzysztof Kotowicz in 2012 when auditing CodeIgniter's XSS filtering function, which this code was based off of. ## Recommendation If you are a developer currently using the xss filter function from the validator package, you should consider replacing it with the escape filter function from the same package. This function replaces all instances of angle brackets (<, >), ampersands, and quotation marks, so no HTML tags will be processed.

CVE-2013-7454 Affected Validator Versions

1 component(s)
Fixed Versions:
1.1.0
Product / Package Ecosystem Affected Versions Fixed Version
validator
npm
< 1.1.0
1.1.0

References

Frequently Asked Questions

What is CVE-2013-7454?
CVE-2013-7454 is a security vulnerability in Validator involving Multiple XSS Filter Bypasses in validator under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Validator versions are affected?
Affected versions include releases prior to 1.1.0 across affected packages: validator.
What version fixes CVE-2013-7454?
Upgrading to 1.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is validator affected?
Yes, validator is affected in releases prior to 1.1.0. Upgrade your dependency to 1.1.0 or later.
What is the CVSS score of CVE-2013-7454?
CVE-2013-7454 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2013-7454?
CVE-2013-7454 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check npm dependencies for CVE-2013-7454?
Run the dependency tree command: 'npm ls validator'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q4qq-fm7q-cwp5",
  "modified" : "2021-09-16T19:30:36Z",
  "published" : "2017-10-24T18:33:36Z",
  "aliases" : [ "CVE-2013-7454" ],
  "summary" : "Multiple XSS Filter Bypasses in validator",
  "details" : "Versions of `validator` prior to 1.1.0 are affected by several cross-site scripting vulnerabilities due to bypasses discovered in the blacklist-based filter.\n\n\n## Proof of Concept\nVarious inputs that could bypass the filter were discovered:\n\nImproper parsing of nested tags:\n\n```\n<s <onmouseover=\"alert(1)\"> <;s onmouseover=\"alert(1)\">This is a test</s>\n```\n\nIncomplete filtering of javascript: URIs:\n\n```\n<a href=\"javascriptJ a V a S c R iPt::alert(1)\" \"<s>\">test</a>\n```\n\nUI Redressing:\n\n```\n<div style=\"z-index: 9999999; background-color: green; width: 100%; height: 100%\">\n<h1>You have won</h1>Please click the link and enter your login details:\n<a href=\"http://example.com/\">http://good.com</a>\n</div>\n```\n\nBypass via Nested Forbidden Strings:\n\n```\n<scrRedirecRedirect 302t 302ipt type=\"text/javascript\">prompt(1);</scrRedirecRedirect 302t 302ipt>\n```\n\nAdditional bypasses were discovered by Krzysztof Kotowicz in 2012 when auditing CodeIgniter's XSS filtering function, which this code was based off of.\n\n\n## Recommendation\n\nIf you are a developer currently using the xss filter function from the validator package, you should consider replacing it with the escape filter function from the same package. This function replaces all instances of angle brackets (<, >), ampersands, and quotation marks, so no HTML tags will be processed.",
  "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" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-7454"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-q4qq-fm7q-cwp5"
  }, {
    "type" : "WEB",
    "url" : "https://nealpoole.com/blog/2013/07/xss-filter-bypass-in-validator-nodejs-module"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/41"
  }, {
    "type" : "WEB",
    "url" : "http://blog.kotowicz.net/2012/07/codeigniter-210-xssclean-cross-site.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2016/04/20/11"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:50:57Z",
    "nvd_published_at" : null
  }
}