pypi package report

Is fastapi safe?

1 known vulnerability, worst severity HIGH.

// reach

20 direct dependencies

10 carry known advisories, worst CRITICAL

522 packages depend on it

an advisory here reaches each of them

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

13 published models carry an advisory from this package

0 pin a version the advisory is confirmed against; the rest declare it without a version.

JackKozmo29/mailguard-jev-style-1.5bHIGHnot pinned
Viggle/MeridianHIGHnot pinned

16 published models

3 declared · 14 observed · 2 inferred

ModelEvidence
autotrust/GEV-26B-Decideobserved
autotrust/GEV-26B-Decide-NVFP4observed
Create a free accountto see all 14 models and per-model risk

16 published AI models are associated with this package: 3 name it in a requirements or pyproject file, 14 load it or import it directly, and 2 are inferred from the runtime stack their declared library pulls in. Only 2 state a version requirement, so this is not a count of affected models.


cvss
8.2
high

CVSS v3.1 base score out of 10

epss
0.72%
medium

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

xyz score
4.9
medium

CyberXYZ composite out of 10

fig. 01 — GHSA-8h2j-cgx8-6xv7, the advisory selected below

// 1 advisories

GHSA-8h2j-cgx8-6xv7

HIGHGitHub ratingCVE-2021-32677
// impact

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

So, a request with a content type of text/plain containing JSON data would be accepted and the JSON data would be extracted.

But requests with content type text/plain are exempt from CORS preflights, for being considered Simple requests. So, the browser would 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.

// patches

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.

// workarounds

It's best to upgrade to the latest FastAPI.

But still, it would be possible to add 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.

// references// for more information

If you have any questions or comments, write to [security@tiangolo.com](mailto:security@tiangolo.com)

// cvss v3.1 vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
None

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

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