CVE-2025-54365

fastapi-guard patch contains bypassable RegEx

Published Jul 23, 2025 CVSS 4.0 · 7.8 High EPSS < 1% KEV · Not listed
Description
fastapi-guard is a security library for FastAPI that provides middleware to control IPs, log requests, detect penetration attempts and more. In version 3.0.1, the regular expression patched to mitigate the ReDoS vulnerability by limiting the length of string fails to catch inputs that exceed this limit. This type of patch fails to detect cases in which the string representing the attributes of a <script> tag exceeds 100 characters. As a result, most of the regex patterns present in version 3.0.1 can be bypassed. This is fixed in version 3.0.2.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2025-22476 FastAPI Guard has a regex bypass
Github GHSA Github GHSA GHSA-rrf6-pxg8-684g FastAPI Guard has a regex bypass
History
Type Values Removed Values Added
First Time appeared Fastapi-guard
Fastapi-guard fastapi Guard
Weaknesses CWE-1333
CPEs cpe:2.3:a:fastapi-guard:fastapi_guard:3.0.1:*:*:*:*:*:*:*
Vendors & Products Fastapi-guard
Fastapi-guard fastapi Guard
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description fastapi-guard is a security library for FastAPI that provides middleware to control IPs, log requests, detect penetration attempts and more. In version 3.0.1, the regular expression patched to mitigate the ReDoS vulnerability by limiting the length of string fails to catch inputs that exceed this limit. This type of patch fails to detect cases in which the string representing the attributes of a <script> tag exceeds 100 characters. As a result, most of the regex patterns present in version 3.0.1 can be bypassed. This is fixed in version 3.0.2.
Title fastapi-guard patch contains bypassable RegEx
Weaknesses CWE-185
CWE-20
References
Metrics cvssV4_0

{'score': 7.8, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N/E:P'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 24, 2025, 1:36 PM
Reserved
Jul 21, 2025, 4:12 PM
Status
Analyzed
Published
Jul 23, 2025, 11:15 PM
Modified
Jun 17, 2026, 9:39 AM