{"id":"CVE-2025-54365","published":"2025-07-23T22:11:36Z","modified":"2025-07-24T13:36:52Z","title":"fastapi-guard patch contains bypassable RegEx","vendor":"rennf93","product":"fastapi-guard","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00871,"percentile":0.59728,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"},{"id":"CWE-185","name":"Incorrect Regular Expression"}],"references":[{"url":"https://github.com/rennf93/fastapi-guard/security/advisories/GHSA-rrf6-pxg8-684g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/rennf93/fastapi-guard/commit/0829292c322d33dc14ab00c5451c5c138148035a","tags":["x_refsource_MISC"]},{"url":"https://github.com/rennf93/fastapi-guard/commit/d9d50e8130b7b434cdc1b001b8cfd03a06729f7f","tags":["x_refsource_MISC"]}],"priority":{"score":17.4,"factors":[{"name":"EPSS percentile","points":11.95},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"rennf93","affectedVersions":[{"vendor":"rennf93","product":"fastapi-guard","versions":[">= 3.0.1, < 3.0.2"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2025-07-24T13:13:00.507260Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"fastapi-guard","vulnerableRanges":[">=3.0.1, <3.0.2"],"patched":["3.0.2"],"from":["GHSA-rrf6-pxg8-684g","PYSEC-2026-1360"],"provenance":"source"}],"summary":{"text":"The fastapi-guard library (by rennf93) version 3.0.1 contains a bypassable regular expression in its ReDoS patch, which fails to catch inputs that exceed the length limit, particularly script tag attributes longer than 100 characters, so most of its regex-based detection patterns can be bypassed. An unauthenticated remote attacker can send crafted HTTP requests to a FastAPI application that uses this middleware, with no user interaction or special configuration required, to evade the detection rules.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:43:07Z"},"euvd":{"id":"EUVD-2025-22476","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-rennf93-fastapi-guard-cve-2025-46814","parents":[{"from":"CVE-2025-46814","to":"CVE-2025-54365","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["guard/middleware.py","guard/models.py","guard/utils.py"],"commits":["https://github.com/rennf93/fastapi-guard/commit/0b003fda4c678c1b514e95f319aee88113e9bf4b","https://github.com/rennf93/fastapi-guard/commit/d9d50e8130b7b434cdc1b001b8cfd03a06729f7f","https://github.com/rennf93/fastapi-guard/commit/0829292c322d33dc14ab00c5451c5c138148035a"],"basis":"shared function","functions":["SecurityConfig","dispatch","is_ip_allowed"]}]}],"packageHistory":[{"cve":"CVE-2025-46814","published":"2025-05-06","fixed":"2.0.0","kev":false},{"cve":"CVE-2025-53539","published":"2025-07-07","fixed":"3.0.1","kev":false,"link":{"from":"CVE-2025-53539","to":"CVE-2025-54365","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:fastapi-guard","fromFixed":"3.0.1","toFixed":"3.0.2","daysApart":16},{"kind":"similar","provenance":"machine","score":0.55,"basis":"same product + description similarity"}]}},{"cve":"CVE-2025-54365","published":"2025-07-23","fixed":"3.0.2","kev":false}],"package":"PyPI:fastapi-guard"}}