---
id: CVE-2025-46814
aliases:
  - PYSEC-2025-242
  - GHSA-77q8-qmj7-x7pp
title: >-
  FastAPI Guard is a security library for FastAPI that provides middleware to
  control IPs, log requests, and detect penetration attempts. A…
summary: >-
  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
  manipulatin…
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'
vendor: fastapi-guard
product: fastapi-guard
ecosystem: pip
affected:
  - fastapi-guard < 2.0.0
patched:
  - fastapi-guard 2.0.0
published: '2025-05-06'
updated: '2026-07-13'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/PYSEC-2025-242'
references:
  - url: >-
      https://github.com/rennf93/fastapi-guard/commit/0b003fda4c678c1b514e95f319aee88113e9bf4b
  - url: >-
      https://github.com/rennf93/fastapi-guard/security/advisories/GHSA-77q8-qmj7-x7pp
tags:
  - osv
  - pip
epss: 0.00322
epssPercentile: 0.22576
ingestedAt: '2026-07-13T18:58:06.662Z'
---

## Overview

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 packages

- `fastapi-guard < 2.0.0`

## Remediation

Upgrade to a patched release:

- `fastapi-guard 2.0.0`
