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-53539

CVE-2025-53539: Fastapi Guard DOS Vulnerability

CVE-2025-53539 is a denial of service vulnerability in Fastapi Guard caused by inefficient regex patterns that trigger polynomial complexity backtracks. This article covers technical details, affected versions, and mitigation.

Published: April 21, 2026

CVE-2025-53539 Overview

CVE-2025-53539 is an Algorithmic Complexity Attack vulnerability affecting FastAPI Guard, a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. The library's penetration attempt detection mechanism uses regular expressions to scan incoming requests; however, some of the regex patterns used in detection are extremely inefficient and can cause polynomial complexity backtracks when handling specially crafted inputs. This vulnerability is classified as CWE-1333 (Inefficient Regular Expression Complexity).

Critical Impact

Remote attackers can craft malicious HTTP requests that trigger catastrophic regex backtracking, causing denial of service conditions in FastAPI applications relying on fastapi-guard for security middleware.

Affected Products

  • FastAPI Guard (fastapi_guard) versions prior to 3.0.1
  • Applications using fastapi-guard penetration detection middleware
  • FastAPI web applications with fastapi-guard security middleware enabled

Discovery Timeline

  • 2025-07-07 - CVE CVE-2025-53539 published to NVD
  • 2025-12-31 - Last updated in NVD database

Technical Details for CVE-2025-53539

Vulnerability Analysis

This vulnerability is a classic Regular Expression Denial of Service (ReDoS) issue stemming from poorly constructed regex patterns within the fastapi-guard library. The penetration detection component of fastapi-guard inspects incoming HTTP requests using regex-based pattern matching to identify malicious payloads. The problematic patterns contain constructs that lead to exponential or polynomial time complexity when processing certain input strings.

When an attacker submits a carefully crafted request containing input designed to exploit the inefficient regex, the pattern matching engine enters a state of catastrophic backtracking. This occurs because the regex engine explores an enormous number of possible matches before ultimately failing, consuming excessive CPU resources during the process. Since this affects security middleware that processes every incoming request, even a single malicious request can tie up server resources.

The vulnerability exists in the cloud handler component where regex patterns are used to parse HTML responses and extract URLs. The original pattern used greedy quantifiers (.*?) without proper bounds, allowing unbounded matching that can be exploited.

Root Cause

The root cause is the use of inefficient regular expression patterns that contain unbounded quantifiers and overlapping alternatives. Specifically, the vulnerable regex patterns use constructs like .*? (non-greedy match of any character) without length restrictions, which can lead to polynomial-time complexity when the regex engine must explore numerous possible match combinations during backtracking. The fix implements bounded quantifiers (.{1,500}?) to limit the maximum match length and prevent excessive backtracking.

Attack Vector

The attack is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by sending HTTP requests containing specially crafted strings designed to trigger worst-case regex matching behavior. The malicious input is processed by the fastapi-guard middleware before reaching the application logic, making all protected endpoints potential attack surfaces. Since the vulnerable component is security middleware, it paradoxically becomes the vector for denial of service attacks against the applications it is meant to protect.

python
# Vulnerable vs Fixed Regex Pattern
# Source: https://github.com/rennf93/fastapi-guard/commit/d9d50e8130b7b434cdc1b001b8cfd03a06729f7f

# VULNERABLE - Unbounded non-greedy quantifier allows catastrophic backtracking
# pattern = r'href=["\'](https://download\.microsoft\.com/' r'.*?\.json)["\']'

# FIXED - Bounded quantifier limits match length to prevent ReDoS
pattern = r'href=["\'](https://download\.microsoft\.com/.{1,500}?\.json)["\']'
match = re.search(pattern, decoded_html)

Source: GitHub Commit

Detection Methods for CVE-2025-53539

Indicators of Compromise

  • Unusually high CPU utilization on FastAPI application servers without corresponding increase in legitimate traffic
  • Slow or unresponsive API endpoints protected by fastapi-guard middleware
  • HTTP requests containing abnormally long or repetitive string patterns in headers, query parameters, or body content
  • Log entries showing extended request processing times for specific malformed requests

Detection Strategies

  • Monitor request processing latency for FastAPI applications using fastapi-guard; sudden spikes may indicate ReDoS exploitation attempts
  • Implement request timeout mechanisms to identify and terminate requests that exceed normal processing duration
  • Review application performance metrics for CPU-bound anomalies correlated with incoming HTTP traffic patterns
  • Deploy Web Application Firewall (WAF) rules to detect and block requests with characteristic ReDoS payload patterns

Monitoring Recommendations

  • Configure application performance monitoring (APM) to alert on regex processing time anomalies
  • Set up resource utilization alerts for CPU spikes on servers running fastapi-guard protected applications
  • Enable detailed logging for requests that exceed processing time thresholds
  • Monitor for repeated requests from single sources containing long repetitive strings

How to Mitigate CVE-2025-53539

Immediate Actions Required

  • Upgrade fastapi-guard to version 3.0.1 or later immediately
  • Review and audit any custom regex patterns used in conjunction with fastapi-guard
  • Implement request timeout limits at the web server or load balancer level as a defense-in-depth measure
  • Consider temporarily disabling fastapi-guard penetration detection if immediate patching is not possible

Patch Information

The vulnerability is fixed in fastapi-guard version 3.0.1. The patch modifies the vulnerable regex patterns to use bounded quantifiers, limiting the maximum length of matched content and preventing catastrophic backtracking. The fix can be reviewed in the GitHub commit d9d50e8130b7b434cdc1b001b8cfd03a06729f7f. Additional details are available in the GitHub Security Advisory GHSA-j47q-rc62-w448.

Workarounds

  • If immediate upgrade is not feasible, implement request body and header size limits at the reverse proxy or load balancer level
  • Deploy a WAF with ReDoS protection capabilities to filter malicious requests before they reach the application
  • Configure request timeout settings to automatically terminate long-running regex operations
  • Consider temporarily bypassing fastapi-guard for non-critical endpoints while preparing for the upgrade
bash
# Upgrade fastapi-guard to patched version
pip install --upgrade fastapi-guard>=3.0.1

# Verify installed version
pip show fastapi-guard | grep Version

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechFastapi Guard

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability0.15%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-1333
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-j47q-rc62-w448
  • Related CVEs
  • CVE-2025-46814: FastAPI Guard Auth Bypass 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