fastapi-guard
A security library for FastAPI that provides middleware to control IPs, log requests, detect penetration attempts, honeypot setup, behavioural analysis, emergency mode lockdown, block Cloud Provider IPs, country blocking, and much more... It integrates seamlessly with FastAPI to offer robust protection against various security threats.
Activity
- Latest release
- 1w ago
- Total releases
- 58
- Cadence
- ~4 days
- Last 12 months
- 30
Reach
- Stars
- 817
Details
- License
- MIT
- First release
- Aug 26, 2024
| Version | Released | |
|---|---|---|
8.0.0
major
| ||
7.8.2
patch
| ||
7.8.1
patch
| ||
7.8.0
minor
| ||
7.7.0
minor
| ||
7.6.0
minor
| ||
7.5.1
patch
| ||
7.5.0
minor
| ||
7.4.1
patch
| ||
7.4.0
minor
| ||
7.3.1
patch
| ||
7.3.0
minor
| ||
7.2.2
patch
| ||
7.2.1
patch
| ||
7.2.0
minor
| ||
7.1.1
patch
| ||
7.1.0
minor
| ||
7.0.0
major
| ||
6.0.0
major
| ||
5.2.0
minor
| ||
5.1.1
patch
| ||
5.1.0
minor
| ||
5.0.0
major
| ||
4.4.1
patch
| ||
4.4.0
minor
| ||
4.3.1
patch
| ||
4.3.0
minor
| ||
4.2.2
patch
| ||
4.2.1
patch
| ||
4.2.0
minor
| ||
4.1.2
patch
| ||
4.1.0
minor
| ||
4.0.3
patch
| ||
4.0.2
patch
| ||
4.0.1
major
| ||
3.0.2
patch
| ||
3.0.1
patch
1 CVE
CVE-2025-54365
PYSEC-2026-1360
GHSA-rrf6-pxg8-684g
Jul 07, 2026
FastAPI Guard has a regex bypass
High
Network
Low
None
None
SummaryThe regular expression patched to mitigate the ReDoS vulnerability by limiting the length of string fails to catch inputs that exceed this limit. DetailsIn version 3.0.1, you can find a commit like the one in the link below, which was made to prevent ReDoS. https://github.com/rennf93/fastapi-guard/commit/d9d50e8130b7b434cdc1b001b8cfd03a06729f7f This commit mitigates the vulnerability by limiting the length of the input string, as shown in the example below.
This type of patch fails to catch cases where the string representing the attributes of a tag exceeds 100 characters. Therefore, most of the regex patterns present in version 3.0.1 can be bypassed. PoC
ImpactDue to this vulnerability, most of the regex patterns can potentially be bypassed, making the application vulnerable to attacks such as XSS and SQL Injection. Affected versions
3.0.1
Fixed in
3.0.2
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
3.0.0
major
1 CVE
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
2.1.3
patch
1 CVE
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
2.1.2
patch
1 CVE
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
2.1.1
patch
1 CVE
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
2.1.0
minor
1 CVE
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
2.0.1
patch
1 CVE
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
2.0.0
major
1 CVE
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
1.5.0
minor
2 CVEs
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46814
PYSEC-2025-242
GHSA-77q8-qmj7-x7pp
May 06, 2025
7.5
/ 10
High
Network
Low
None
None
Unchanged
None
High
None
FastAPI Guard is a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. An HTTP header injection vulnerability has been identified in versions prior to 2.0.0. By manipulating the X-Forwarded-For header, an attacker can potentially inject arbitrary IP addresses into the request. This vulnerability can allow attackers to bypass IP-based access controls, mislead logging systems, and impersonate trusted clients. It is especially impactful when the application relies on the X-Forwarded-For header for IP-based authorization or authentication. Users should upgrade to FastAPI Guard version 2.0.0 to receive a fix. Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 2 more Show less
1.4.0
1.5.0
Fixed in
2.0.0
References Updated Jul 13, 2026 · Source: OSV.dev | ||
1.4.0
minor
2 CVEs
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46814
PYSEC-2025-242
GHSA-77q8-qmj7-x7pp
May 06, 2025
7.5
/ 10
High
Network
Low
None
None
Unchanged
None
High
None
FastAPI Guard is a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. An HTTP header injection vulnerability has been identified in versions prior to 2.0.0. By manipulating the X-Forwarded-For header, an attacker can potentially inject arbitrary IP addresses into the request. This vulnerability can allow attackers to bypass IP-based access controls, mislead logging systems, and impersonate trusted clients. It is especially impactful when the application relies on the X-Forwarded-For header for IP-based authorization or authentication. Users should upgrade to FastAPI Guard version 2.0.0 to receive a fix. Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 2 more Show less
1.4.0
1.5.0
Fixed in
2.0.0
References Updated Jul 13, 2026 · Source: OSV.dev | ||
1.3.2
minor
2 CVEs
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46814
PYSEC-2025-242
GHSA-77q8-qmj7-x7pp
May 06, 2025
7.5
/ 10
High
Network
Low
None
None
Unchanged
None
High
None
FastAPI Guard is a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. An HTTP header injection vulnerability has been identified in versions prior to 2.0.0. By manipulating the X-Forwarded-For header, an attacker can potentially inject arbitrary IP addresses into the request. This vulnerability can allow attackers to bypass IP-based access controls, mislead logging systems, and impersonate trusted clients. It is especially impactful when the application relies on the X-Forwarded-For header for IP-based authorization or authentication. Users should upgrade to FastAPI Guard version 2.0.0 to receive a fix. Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 2 more Show less
1.4.0
1.5.0
Fixed in
2.0.0
References Updated Jul 13, 2026 · Source: OSV.dev | ||
1.2.2
patch
2 CVEs
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46814
PYSEC-2025-242
GHSA-77q8-qmj7-x7pp
May 06, 2025
7.5
/ 10
High
Network
Low
None
None
Unchanged
None
High
None
FastAPI Guard is a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. An HTTP header injection vulnerability has been identified in versions prior to 2.0.0. By manipulating the X-Forwarded-For header, an attacker can potentially inject arbitrary IP addresses into the request. This vulnerability can allow attackers to bypass IP-based access controls, mislead logging systems, and impersonate trusted clients. It is especially impactful when the application relies on the X-Forwarded-For header for IP-based authorization or authentication. Users should upgrade to FastAPI Guard version 2.0.0 to receive a fix. Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 2 more Show less
1.4.0
1.5.0
Fixed in
2.0.0
References Updated Jul 13, 2026 · Source: OSV.dev | ||
1.2.1
patch
2 CVEs
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46814
PYSEC-2025-242
GHSA-77q8-qmj7-x7pp
May 06, 2025
7.5
/ 10
High
Network
Low
None
None
Unchanged
None
High
None
FastAPI Guard is a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. An HTTP header injection vulnerability has been identified in versions prior to 2.0.0. By manipulating the X-Forwarded-For header, an attacker can potentially inject arbitrary IP addresses into the request. This vulnerability can allow attackers to bypass IP-based access controls, mislead logging systems, and impersonate trusted clients. It is especially impactful when the application relies on the X-Forwarded-For header for IP-based authorization or authentication. Users should upgrade to FastAPI Guard version 2.0.0 to receive a fix. Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 2 more Show less
1.4.0
1.5.0
Fixed in
2.0.0
References Updated Jul 13, 2026 · Source: OSV.dev | ||
1.2.0
minor
2 CVEs
CVE-2025-53539
PYSEC-2026-1359
GHSA-j47q-rc62-w448
Jul 07, 2026
fastapi-guard is vulnerable to ReDoS through inefficient regex
Medium
Network
Low
None
None
Summaryfastapi-guard detects penetration attempts by using regex patterns 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. It is not as severe as exponential complexity ReDoS, but still downgrades performance and allows DoS exploits. An attacker can trigger high cpu usage and make a service unresponsive for hours by sending a single request in size of KBs. PoCe.g. https://github.com/rennf93/fastapi-guard/blob/1e6c2873bfc7866adcbe5fc4da72f2d79ea552e7/guard/handlers/suspatterns_handler.py#L31C79-L32C7
Single-threaded uvicorn workers can not handle any other concurrent requests during the elapsed time. ImpactPenetration detection is enabled by default. Services that use fastapi-guard middleware without explicitly setting Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 9 more Show less
1.4.0
1.5.0
2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.1.3
3.0.0
Fixed in
3.0.1
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46814
PYSEC-2025-242
GHSA-77q8-qmj7-x7pp
May 06, 2025
7.5
/ 10
High
Network
Low
None
None
Unchanged
None
High
None
FastAPI Guard is a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. An HTTP header injection vulnerability has been identified in versions prior to 2.0.0. By manipulating the X-Forwarded-For header, an attacker can potentially inject arbitrary IP addresses into the request. This vulnerability can allow attackers to bypass IP-based access controls, mislead logging systems, and impersonate trusted clients. It is especially impactful when the application relies on the X-Forwarded-For header for IP-based authorization or authentication. Users should upgrade to FastAPI Guard version 2.0.0 to receive a fix. Affected versions
0.1.0
0.2.0
0.3.2
0.3.3
0.3.4
0.4.0
1.0.0
1.1.0
1.2.0
1.2.1
1.2.2
1.3.2
+ 2 more Show less
1.4.0
1.5.0
Fixed in
2.0.0
References Updated Jul 13, 2026 · Source: OSV.dev |