Miggo Logo

CVE-2021-32838: Regular Expression Denial of Service in flask-restx

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.79331%
Published
9/8/2021
Updated
9/20/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
flask-restxpip< 0.5.10.5.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the email_regex regular expression in flask_restx/inputs.py, which was explicitly patched in the commit bab31e0 to optimize its complexity. The original regex's server component ([^@]+(?:.[^@]+)*) contained a non-atomic repetition that could cause catastrophic backtracking on malicious inputs. The email validator's call method directly utilizes this regex for validation, making it the entry point for the ReDoS vulnerability. The commit diff, CVE description, and advisory references all explicitly point to this regex as the root cause.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*l*sk R*STX *ont*ins * r**ul*r *xpr*ssion t**t is vuln*r**l* to [R**oS](*ttps://ow*sp.or*/www-*ommunity/*tt**ks/R**ul*r_*xpr*ssion_**ni*l_o*_S*rvi**_-_R**oS) (R**ul*r *xpr*ssion **ni*l o* S*rvi**) in `*m*il_r***x`.

Reasoning

T** vuln*r**ility st*ms *rom t** *m*il_r***x r**ul*r *xpr*ssion in *l*sk_r*stx/inputs.py, w*i** w*s *xpli*itly p*t**** in t** *ommit ******* to optimiz* its *ompl*xity. T** ori*in*l r***x's s*rv*r *ompon*nt ([^@]+(?:\.[^@]+)*) *ont*in** * non-*tomi*