CVE-2025-46814 FastAPI Guard Remote Header Injection via X-Forwarded-For Manipulation
Attackers can bypass IP-based access controls and impersonate clients by manipulating the X-Forwarded-For header in FastAPI Guard.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2025-46814?
CVE-2025-46814 is a low-severity vulnerability in rennf93 fastapi-guard, published on 6 May 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
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.
Weakness: CWE-74
Which versions are affected by CVE-2025-46814?
1 open source package ship an affected version, including fastapi-guard. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
fastapi-guard PyPI | All versions | 2.0.0 |
Products include Fastapi-Guard Fastapi Guard.
How do I fix CVE-2025-46814?
Upgrade fastapi-guard to 2.0.0 or later.
Is CVE-2025-46814 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-46814 exists.
Other vulnerabilities in rennf93 fastapi-guard
Sources
Also known as GHSA-77q8-qmj7-x7pp, PYSEC-2025-242.