Miggo Logo

CVE-2021-3794: Inefficient Regular Expression Complexity in vuelidate

7.5

CVSS Score
3.0

Basic Information

EPSS Score
0.51056%
Published
9/20/2021
Updated
1/30/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
@vuelidate/validatorsnpm<= 2.0.0-alpha.212.0.0-alpha.22

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the insecure regular expression in the url validator. The commit diff shows a fundamental rewrite of the regex pattern in url.js, specifically replacing a vulnerable custom regex with a known safer pattern from dperini/729294. The original regex had multiple nested quantifiers and ambiguous patterns that could cause exponential time complexity with certain malicious inputs. The tests in url.spec.js were updated to handle domain endings with trailing dots, but the core vulnerability was in the regex implementation within the url validator function itself.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

vu*li**t* is * simpl*, li**tw*i**t mo**l-**s** v*li**tion *or Vu*.js *.x & *.*. * R**oS (r**ul*r *xpr*ssion **ni*l o* s*rvi**) *l*w w*s *oun* in t** `@vu*li**t*/v*li**tors` p**k***. *n *tt**k*r t**t is **l* to provi** *r**t** input to t** url(input)

Reasoning

T** vuln*r**ility st*ms *rom t** ins**ur* r**ul*r *xpr*ssion in t** url v*li**tor. T** *ommit *i** s*ows * *un**m*nt*l r*writ* o* t** r***x p*tt*rn in `url.js`, sp**i*i**lly r*pl**in* * vuln*r**l* *ustom r***x wit* * known s***r p*tt*rn *rom *p*rini/