CVE-2020-26308: Validate.js Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-rv73-9c8w-jp4c
CWE-1333
Published
Advisory Summary

CVE-2020-26308 is a MODERATE denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Validate.js libraries in the npm ecosystem. The issue involves validate.js regular expression denial of service vulnerability. Remediation is available in the latest vendor maintenance releases.

CVE-2020-26308 at a Glance

CVE Identifier CVE-2020-26308
GHSA Identifier GHSA-rv73-9c8w-jp4c
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Validate.js
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2020-26308

To remediate this vulnerability, upgrade all affected Validate.js dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

validate.js fixed: Latest secure release
npm install validate.js@Latest secure release
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 validate.js

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2020-26308, inspect your project dependencies using npm:

npm ls validate.js

Analyze the terminal output to locate any version of Validate.js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls validate.js 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-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Validate.js, 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

Validate.js provides a declarative way of validating javascript objects. Versions 0.13.1 and prior contain one or more regular expressions that are vulnerable to Regular Expression Denial of Service (ReDoS). As of time of publication, no known patches are available.

CVE-2020-26308 Affected Validate.js Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
validate.js
npm
≤ 0.13.1

References

Frequently Asked Questions

What is CVE-2020-26308?
CVE-2020-26308 is a security vulnerability in Validate.js involving validate.js Regular Expression Denial of Service vulnerability under CWE-1333: Inefficient Regular Expression Complexity.
Which Validate.js versions are affected?
Affected versions include releases prior to current release patches across affected packages: validate.js.
What version fixes CVE-2020-26308?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is validate.js affected?
Yes, validate.js is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2020-26308?
CVE-2020-26308 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check npm dependencies for CVE-2020-26308?
Run the dependency tree command: 'npm ls validate.js'. 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-rv73-9c8w-jp4c",
  "modified" : "2024-10-28T14:51:32Z",
  "published" : "2024-10-26T21:30:46Z",
  "aliases" : [ "CVE-2020-26308" ],
  "summary" : "validate.js Regular Expression Denial of Service vulnerability",
  "details" : "Validate.js provides a declarative way of validating javascript objects. Versions 0.13.1 and prior contain one or more regular expressions that are vulnerable to Regular Expression Denial of Service (ReDoS). As of time of publication, no known patches are available.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U/U:Green"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "validate.js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.13.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26308"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ansman/validate.js/issues/342"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ansman/validate.js"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2020-302-redos-validate.js"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-28T14:51:32Z",
    "nvd_published_at" : "2024-10-26T21:15:14Z"
  }
}