Use of Less Trusted Source Affecting fastapi-guard package, versions [,2.0.0)


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.06% (19th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-FASTAPIGUARD-10245561
  • published26 May 2025
  • disclosed6 May 2025
  • creditamooryx

Introduced: 6 May 2025

NewCVE-2025-46814  (opens in a new tab)
CWE-348  (opens in a new tab)

How to fix?

Upgrade fastapi-guard to version 2.0.0 or higher.

Overview

fastapi-guard is a Security library for FastAPI to control IPs and more.

Affected versions of this package are vulnerable to Use of Less Trusted Source via the manipulation of the X-Forwarded-For header. An attacker can inject arbitrary IP addresses into the request by manipulating this header. This can lead to bypassing IP-based access controls, misleading logging systems, and impersonating trusted clients.

PoC

Run the FastAPI application locally:

uvicorn main:app --host 0.0.0.0 --port 8000

Send a crafted request with a manipulated X-Forwarded-For header:

curl -i http://127.0.0.1:8000/ -H "X-Forwarded-For: 8.8.8.8"

CVSS Base Scores

version 4.0
version 3.1