CVE-2025-53539 ReDoS in fastapi-guard's penetration attempts detector
Attackers can cause denial of service in FastAPI Guard by sending crafted inputs that trigger inefficient regex backtracking in penetration detection.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-53539?
CVE-2025-53539 is a medium-severity denial of service vulnerability in rennf93 fastapi-guard, published on 7 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
FastAPI Guard is a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. fastapi-guard's penetration attempts detection uses regex to scan incoming requests. However, some of the regex patterns used in detection are extremely inefficient and can cause polynomial complexity backtracks when handling specially crafted inputs. This vulnerability is fixed in 3.0.1.
Weakness: CWE-1333
Which versions are affected by CVE-2025-53539?
3 open source packages ship an affected version, including fastapi-guard. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
fastapi-guard PyPI | All versions | 3.0.1 |
fastapi-guard PyPI | All versions | 3.0.1 |
fastapi-guard PyPI | All versions | 3.0.1 |
Products include Fastapi-Guard Fastapi Guard.
How do I fix CVE-2025-53539?
Upgrade fastapi-guard to 3.0.1 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2025-53539 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-53539 exists.
Other vulnerabilities in rennf93 fastapi-guard
Sources
Also known as GHSA-j47q-rc62-w448, PYSEC-2026-1359.