# CVE-2025-54365: fastapi-guard patch contains bypassable RegEx

- Severity: High 7.8 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.94%, higher than 61% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-07-23T15:31:12.000Z
- Modified: 2026-09-10T03:50:26.308Z
- Also known as: GHSA-rrf6-pxg8-684g, PYSEC-2026-1360
- Weaknesses: CWE-20, CWE-185, CWE-1333
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- rennf93 fastapi-guard: >= 3.0.1, < 3.0.2
- fastapi-guard (PyPI): from 3.0.1 before 3.0.2
- fastapi-guard fastapi_guard: 3.0.1

## Every score

- GitHub_M: CVSS:4.0 7.8 High `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`
- GitHub: CVSS:4.0 High `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`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:4.0 `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`

## References

- <https://github.com/rennf93/fastapi-guard/security/advisories/GHSA-rrf6-pxg8-684g> (exploit, vendor-advisory, web)
- <https://github.com/rennf93/fastapi-guard/commit/0829292c322d33dc14ab00c5451c5c138148035a> (patch, web)
- <https://github.com/rennf93/fastapi-guard/commit/d9d50e8130b7b434cdc1b001b8cfd03a06729f7f> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-54365> (advisory)
- <https://github.com/rennf93/fastapi-guard> (package)
- <https://pypi.org/project/fastapi-guard> (package)
- <https://github.com/advisories/GHSA-rrf6-pxg8-684g> (advisory)

## Sources

- CVE List: [CVE-2025-54365](https://www.cve.org/CVERecord?id=CVE-2025-54365), CVE Terms of Use, modified 2025-07-24
- GitHub Advisory Database: [GHSA-rrf6-pxg8-684g](https://github.com/advisories/GHSA-rrf6-pxg8-684g), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-54365](https://nvd.nist.gov/vuln/detail/CVE-2025-54365), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1360](https://osv.dev/vulnerability/PYSEC-2026-1360), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-54365 · Whole record: https://cve.day/CVE-2025-54365.json · Rebuilt by cve.day 2026-11-25T22:59:01.622Z
