GHSA-xx4c-jj58-r7x6: Validator Inefficient Regular Expression Complexity Vulnerability
MODERATEGHSA-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
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 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.
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 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
GHSA-xx4c-jj58-r7x6 Affected Validator Versions
1 component(s)| 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?
Which Validator versions are affected?
What version fixes GHSA-xx4c-jj58-r7x6?
Is validator affected?
What is the CVSS score of GHSA-xx4c-jj58-r7x6?
What CWE is associated with GHSA-xx4c-jj58-r7x6?
How can I check npm dependencies for GHSA-xx4c-jj58-r7x6?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}