Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-46814

CVE-2025-46814: FastAPI Guard Auth Bypass Vulnerability

CVE-2025-46814 is an authentication bypass flaw in FastAPI Guard that allows attackers to manipulate X-Forwarded-For headers and bypass IP-based access controls. This article covers technical details, affected versions, and mitigation.

Published: April 28, 2026

CVE-2025-46814 Overview

CVE-2025-46814 is an HTTP header injection vulnerability affecting FastAPI Guard, a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. 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.

Critical Impact

This vulnerability enables attackers to bypass IP-based authentication and authorization controls by injecting arbitrary IP addresses via the X-Forwarded-For header, potentially gaining unauthorized access to protected resources.

Affected Products

  • FastAPI Guard versions prior to 2.0.0
  • Applications relying on X-Forwarded-For header for IP-based authorization
  • FastAPI applications using fastapi_guard middleware for access control

Discovery Timeline

  • 2025-05-06 - CVE-2025-46814 published to NVD
  • 2025-12-31 - Last updated in NVD database

Technical Details for CVE-2025-46814

Vulnerability Analysis

This HTTP header injection vulnerability (CWE-74) exists in FastAPI Guard's handling of the X-Forwarded-For HTTP header. The vulnerability allows network-based attacks without requiring user interaction or special privileges. The primary impact is on the integrity of IP-based access controls, as attackers can manipulate the perceived client IP address.

When FastAPI Guard processes incoming requests, it trusts the X-Forwarded-For header value without proper validation, allowing malicious actors to inject arbitrary IP addresses. This is particularly dangerous in environments where IP whitelisting is used for authentication or authorization decisions.

Root Cause

The root cause of this vulnerability stems from improper input validation of the X-Forwarded-For header. Prior to version 2.0.0, the FastAPI Guard middleware did not properly validate or sanitize IP addresses extracted from client-supplied headers. The fix introduced proper IP address validation using Python's ipaddress module, specifically adding IPv4Address and ip_network imports to validate incoming IP addresses.

Attack Vector

The attack vector is network-based, requiring no authentication and no user interaction. An attacker can exploit this vulnerability by crafting HTTP requests with malicious X-Forwarded-For header values. The attack is especially impactful when:

  • The application uses IP-based allowlisting or blocklisting
  • Logging systems rely on the extracted IP for audit trails
  • Rate limiting is implemented based on client IP addresses
  • Trusted internal networks are granted elevated privileges based on IP
python
# Security patch in guard/middleware.py showing the fix
# Source: https://github.com/rennf93/fastapi-guard/commit/0b003fda4c678c1b514e95f319aee88113e9bf4b

 import logging
 import time
 from collections.abc import Awaitable, Callable
+from ipaddress import IPv4Address, ip_network
 
 from fastapi import FastAPI, Request, Response, status
 from fastapi.middleware.cors import CORSMiddleware

The patch adds proper IP address validation using Python's ipaddress module to validate that X-Forwarded-For header values contain legitimate IP addresses rather than arbitrary injected content.

Detection Methods for CVE-2025-46814

Indicators of Compromise

  • Unusual or malformed IP addresses appearing in application logs from X-Forwarded-For headers
  • Multiple requests from different source IPs claiming the same X-Forwarded-For value
  • Access from external networks using internal/trusted IP ranges in X-Forwarded-For
  • Requests with excessively long or malformed X-Forwarded-For header chains

Detection Strategies

  • Implement log analysis rules to detect discrepancies between actual source IP and X-Forwarded-For values
  • Monitor for requests containing reserved or private IP ranges in X-Forwarded-For from external sources
  • Deploy Web Application Firewall (WAF) rules to validate X-Forwarded-For header formats
  • Create alerts for sudden changes in IP-based access patterns

Monitoring Recommendations

  • Enable detailed HTTP header logging for all requests processed by FastAPI Guard
  • Monitor application access logs for IP spoofing patterns, especially access to protected endpoints
  • Implement anomaly detection for IP-based authentication and authorization systems
  • Review audit logs regularly for signs of access control bypass attempts

How to Mitigate CVE-2025-46814

Immediate Actions Required

  • Upgrade FastAPI Guard to version 2.0.0 or later immediately
  • Review application logs for any historical evidence of exploitation
  • Audit IP-based access control configurations and verify their effectiveness
  • Consider implementing additional authentication mechanisms beyond IP-based controls

Patch Information

The vulnerability has been fixed in FastAPI Guard version 2.0.0. The security patch introduces proper IP address validation using Python's ipaddress module to ensure that only valid IP addresses are processed from the X-Forwarded-For header.

For detailed information about this vulnerability, refer to the GitHub Security Advisory GHSA-77q8-qmj7-x7pp.

Workarounds

  • If upgrading immediately is not possible, implement upstream proxy configuration to strip or validate X-Forwarded-For headers before they reach the application
  • Configure reverse proxies (nginx, Apache, etc.) to set trusted X-Forwarded-For values and ignore client-supplied headers
  • Implement application-level validation of IP addresses before using them for access control decisions
bash
# Example nginx configuration to set trusted X-Forwarded-For
# Place in nginx server or location block

# Clear any existing X-Forwarded-For from client
proxy_set_header X-Forwarded-For $remote_addr;

# Or for multi-proxy setups, append only the direct client IP
# proxy_set_header X-Forwarded-For "$proxy_add_x_forwarded_for";

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechFastapi Guard

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.23%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-74
  • Vendor Resources
  • GitHub Commit Changes

  • GitHub Security Advisory GHSA-77q8-qmj7-x7pp
  • Related CVEs
  • CVE-2025-53539: Fastapi Guard DOS Vulnerability

  • CVE-2025-54365: Fastapi Guard XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English