GHSA-xx4c-jj58-r7x6: Validator Inefficient Regular Expression Complexity Vulnerability

MODERATE
CVSS 5.3
CWE-1333
Published
Advisory Summary

GHSA-xx4c-jj58-r7x6 is a MODERATE (CVSS 5.3) inefficient regular expression complexity vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Validator libraries in the npm ecosystem. The issue involves inefficient regular expression complexity in validator.js. Remediation is available by upgrading affected packages to version 13.7.0.

GHSA-xx4c-jj58-r7x6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xx4c-jj58-r7x6
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Validator
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:N/S:U/C:N/I:N/A:L).

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

How to Fix GHSA-xx4c-jj58-r7x6

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: 13.7.0
npm install validator@13.7.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 GHSA-xx4c-jj58-r7x6, 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 13.7.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-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 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

### Impact Versions of `validator` prior to 13.7.0 are affected by an inefficient Regular Expression complexity when using the `rtrim` and `trim` sanitizers. ### Patches The problem has been patched in validator 13.7.0

GHSA-xx4c-jj58-r7x6 Affected Validator Versions

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

References

Frequently Asked Questions

What is GHSA-xx4c-jj58-r7x6?
GHSA-xx4c-jj58-r7x6 is a security vulnerability in Validator involving Inefficient Regular Expression Complexity in Validator.js under CWE-1333: Inefficient Regular Expression Complexity.
Which Validator versions are affected?
Affected versions include releases prior to 13.7.0 across affected packages: validator.
What version fixes GHSA-xx4c-jj58-r7x6?
Upgrading to 13.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is validator affected?
Yes, validator is affected in releases prior to 13.7.0. Upgrade your dependency to 13.7.0 or later.
What is the CVSS score of GHSA-xx4c-jj58-r7x6?
GHSA-xx4c-jj58-r7x6 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with GHSA-xx4c-jj58-r7x6?
GHSA-xx4c-jj58-r7x6 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 GHSA-xx4c-jj58-r7x6?
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-xx4c-jj58-r7x6",
  "modified" : "2022-07-12T00:11:53Z",
  "published" : "2021-11-19T20:14:23Z",
  "aliases" : [ ],
  "summary" : "Inefficient Regular Expression Complexity in Validator.js",
  "details" : "### Impact\nVersions of `validator` prior to 13.7.0 are affected by an inefficient Regular Expression complexity  when using the `rtrim` and `trim` sanitizers.\n\n### Patches\nThe problem has been patched in validator 13.7.0",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "validator"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.1.0"
      }, {
        "fixed" : "13.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/validatorjs/validator.js/security/advisories/GHSA-xx4c-jj58-r7x6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3765"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/validatorjs/validator.js/issues/1599"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/validatorjs/validator.js/pull/1738"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/validatorjs/validator.js"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/c37e975c-21a3-4c5f-9b57-04d63b28cfc9"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-08T21:27:48Z",
    "nvd_published_at" : null
  }
}