CVE-2025-53539
Python vulnerability analysis and mitigation

Overview

FastAPI Guard is a security library for FastAPI that provides middleware to control IPs, log requests, and detect penetration attempts. A vulnerability was discovered in versions up to 3.0.0 where the penetration attempts detection feature uses inefficient regex patterns to scan incoming requests, leading to polynomial complexity backtracks when handling specially crafted inputs. The vulnerability was disclosed on July 7, 2025 and assigned CVE-2025-53539 (NVD, GitHub Advisory).

Technical details

The vulnerability stems from unbounded regex quantifiers in the penetration detection patterns that can cause polynomial complexity backtracking. When processing specially crafted inputs, these inefficient patterns can trigger excessive CPU usage. The vulnerability has been assigned CWE-1333 (Inefficient Regular Expression Complexity) and received a CVSS v4.0 score of 6.9 MEDIUM with 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 (Miggo).

Impact

Since penetration detection is enabled by default, services using fastapi-guard middleware without explicitly disabling this feature are vulnerable to Denial of Service (DoS) attacks. An attacker can trigger high CPU usage and make a service unresponsive for hours by sending a single request in size of KBs. Single-threaded uvicorn workers cannot handle any other concurrent requests during the processing of malicious input (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in version 3.0.1 by replacing unbounded regex quantifiers with bounded ones to prevent catastrophic backtracking. For users unable to upgrade immediately, a workaround is available by explicitly setting enablepenetrationdetection=False in the middleware configuration (GitHub Commit).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66423HIGH7.1
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-66454MEDIUM6.5
  • PythonPython
  • arcade-mcp-server
NoYesDec 02, 2025
CVE-2025-66424MEDIUM6.5
  • PythonPython
  • trytond
NoYesNov 30, 2025
CVE-2025-66422MEDIUM4.3
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-65858LOW3.5
  • PythonPython
  • calibreweb
NoNoDec 02, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management