Version 0.115.5

fastapi

FastAPI framework, high performance, easy to learn, fast to code, ready for production

Install Instructions

pip install fastapi
Current Version Release Date November 12, 2024
Language Python
Package URL (purl) pkg:pip/fastapi@0.115.5

Find fastapi vulnerabilities in your supply chain.

Scan for Free

fastapi Vulnerabilities

Sort by
icon CVE (Latest)
  • icon CVE (Latest)
  • icon CVE (Oldest)
  • icon CVSS Score (Highest)
  • icon CVSS Score (Lowest)
CVE question mark icon CVSS Score question mark icon CWE(s) question mark icon EPSS Score question mark icon EPSS % question mark icon Impacted Versions
CVE-2024-24762 High 7.5 CWE-1333, CWE-400 0.00124 0.48295
  • 0.1.0–0.109.0
CVE-2021-32677 High 8.1 CWE-352 0.00088 0.3874
  • 0.1.0–0.65.1

fastapi Vulnerability Remediation Guidance

CVE Description Full list of Impacted Versions Fix
CVE-2024-24762 FastAPI is a web framework for building APIs with Python 3.8+ based on standard Python type hints. When using form data, `python-multipart` uses a Regular Expression to parse the HTTP `Content-Type` header, including options. An attacker could send a custom-made `Content-Type` option that is very difficult for the RegEx to process, consuming CPU resources and stalling indefinitely (minutes or more) while holding the main event loop. This means that process can't handle any more requests. It's a ReDoS(Regular expression Denial of Service), it only applies to those reading form data, using `python-multipart`. This vulnerability has been patched in version 0.109.1. 0.89.1, 0.74.1, 0.107.0, 0.105.0, 0.82.0, 0.81.0, 0.77.1, 0.96.1 (Show all) Minor → 0.109.1
CVE-2021-32677 FastAPI is a web framework for building APIs with Python 3.6+ based on standard Python type hints. FastAPI versions lower than 0.65.2 that used cookies for authentication in path operations that received JSON payloads sent by browsers were vulnerable to a Cross-Site Request Forgery (CSRF) attack. In versions lower than 0.65.2, FastAPI would try to read the request payload as JSON even if the content-type header sent was not set to application/json or a compatible JSON media type (e.g. application/geo+json). A request with a content type of text/plain containing JSON data would be accepted and the JSON data would be extracted. Requests with content type text/plain are exempt from CORS preflights, for being considered Simple requests. The browser will execute them right away including cookies, and the text content could be a JSON string that would be parsed and accepted by the FastAPI application. This is fixed in FastAPI 0.65.2. The request data is now parsed as JSON only if the content-type header is application/json or another JSON compatible media type like application/geo+json. It's best to upgrade to the latest FastAPI, but if updating is not possible then a middleware or a dependency that checks the content-type header and aborts the request if it is not application/json or another JSON compatible content type can act as a mitigating workaround. 0.6.0, 0.61.1, 0.56.0, 0.53.1, 0.50.0, 0.27.2, 0.27.1, 0.19.0 (Show all) Minor → 0.109.1

Instantly see if these fastapi vulnerabilities affect your code.

Scan for Free

Dependencies

Packages using versions of fastapi affected by its vulnerabilities

Dependent Packages
starlette<0.42.0,>=0.40.0
pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0,>=1.7.4
typing-extensions>=4.8.0
fastapi-cli[standard]>=0.0.5; extra == "standard"
httpx>=0.23.0; extra == "standard"
jinja2>=2.11.2; extra == "standard"
python-multipart>=0.0.7; extra == "standard"
email-validator>=2.0.0; extra == "standard"
uvicorn[standard]>=0.12.0; extra == "standard"
fastapi-cli[standard]>=0.0.5; extra == "all"
httpx>=0.23.0; extra == "all"
jinja2>=2.11.2; extra == "all"
python-multipart>=0.0.7; extra == "all"
itsdangerous>=1.1.0; extra == "all"
pyyaml>=5.3.1; extra == "all"
ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,>=4.0.1; extra == "all"
orjson>=3.2.1; extra == "all"
email-validator>=2.0.0; extra == "all"
uvicorn[standard]>=0.12.0; extra == "all"
pydantic-settings>=2.0.0; extra == "all"
pydantic-extra-types>=2.0.0; extra == "all"