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

flask-restx Updated 02 Oct 2025

Summary

08/09/2021
Yes i
High
7.5

CVE-2021-32838: Regular Expression Denial of Service in flask-restx. Affects flask-restx versions < 0.5.1. Fixed in 0.5.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Flask-RESTX is a Python library that adds support for quickly building REST APIs. It provides a set of decorators and tools to define API endpoints, handle request parsing, and generate API documentation. The library is widely used in Python web development projects. However, it is vulnerable to a Regular Expression Denial of Service (ReDoS) attack in the email_regex component.

Vulnerability Detail

The vulnerability in flask-restx arises from a regular expression pattern that is susceptible to ReDoS attacks. ReDoS attacks occur when a malicious user provides input that causes the regular expression engine to exhibit exponential time complexity. In this case, the email_regex pattern can be exploited by an attacker to cause a denial of service by providing a specially crafted email address. The attack can consume excessive CPU resources and potentially render the application unresponsive. The severity of this vulnerability is rated as HIGH with a CVSS score of 7.5.

How To Fix

Minimum fixed version

0.5.1

This is the first release that contains the fix.

pip install --upgrade "flask-restx==0.5.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update to the fixed version of flask-restx to mitigate the risk of ReDoS attacks.

Conclusion

Flask-RESTX is vulnerable to a Regular Expression Denial of Service (ReDoS) attack in the email_regex component. This vulnerability can be mitigated by updating to version 0.5.1 or later. It is recommended to promptly update the library to ensure the security and stability of your application. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for flask-restx →

Share this vulnerability

FAQ

Flask-RESTX is a Python library that simplifies the process of building REST APIs. It provides decorators and tools for defining API endpoints, handling request parsing, and generating API documentation.

A ReDoS (Regular Expression Denial of Service) attack occurs when a malicious user provides input that causes a regular expression pattern to exhibit exponential time complexity. This can lead to excessive CPU usage and denial of service.

The vulnerability in flask-restx can be exploited by an attacker to cause a denial of service by providing a specially crafted email address. This can result in excessive CPU usage and potentially render the application unresponsive.

To fix this vulnerability, update flask-restx to version 0.5.1 or later. This version includes a fix for the vulnerable regular expression pattern.

There is no known workaround for this vulnerability. It is crucial to update to the fixed version of flask-restx to mitigate the risk of ReDoS attacks.

How To Fix

Minimum fixed version

0.5.1

This is the first release that contains the fix.

pip install --upgrade "flask-restx==0.5.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback