CVE-2021-3765: Validator Inefficient Regular Expression Complexity Vulnerability
MODERATECVE-2021-3765 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.
CVE-2021-3765 at a Glance
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).
How to Fix CVE-2021-3765
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.
npm install validator@13.7.0
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-2021-3765, 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
CVE-2021-3765 Affected Validator Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
validator
|
npm |
< 13.7.0
|
13.7.0
|
References
Frequently Asked Questions
What is CVE-2021-3765?
Which Validator versions are affected?
What version fixes CVE-2021-3765?
Is validator affected?
What is the CVSS score of CVE-2021-3765?
What CWE is associated with CVE-2021-3765?
How can I check npm dependencies for CVE-2021-3765?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qgmg-gppg-76g5",
"modified" : "2021-11-03T14:46:00Z",
"published" : "2021-11-03T17:34:45Z",
"aliases" : [ "CVE-2021-3765" ],
"summary" : "Inefficient Regular Expression Complexity in validator.js",
"details" : "validator.js prior to 13.7.0 is vulnerable to Inefficient Regular Expression Complexity",
"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" : "0"
}, {
"fixed" : "13.7.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3765"
}, {
"type" : "WEB",
"url" : "https://github.com/validatorjs/validator.js/commit/496fc8b2a7f5997acaaec33cc44d0b8dba5fb5e1"
}, {
"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-03T14:46:00Z",
"nvd_published_at" : "2021-11-02T07:15:00Z"
}
}