Skip to content

MAL-2026-4750

Malicious code in fastapi (PyPI)

Not rated yet Withdrawn May 26, 2026 PyPI
Severity
Not rated yet
No source has published a CVSS score yet
Exploit chance (EPSS)
—
No score published
Known exploited
No
Not in CISA's catalog
Weakness
—
Not classified
Fix
None yet
No fixed version published

Description


-= Per source details. Do not edit below this line.=-

Source: amazon-inspector (a753fd569a7bb908b7cdf82fe0228dc0e24dcc253b67993af5dd5c30b61f4411)

This release of fastapi 0.136.3 modifies pyproject.toml and PKG-INFO to add an undocumented dependency 'fastar>=0.9.0' to the [project.optional-dependencies] standard group (pyproject.toml line 67: "fastar >= 0.9.0",; PKG-INFO line 47: Requires-Dist: fastar>=0.9.0; extra == "standard"). The README documents every other dependency in the [standard] group (httpx, jinja2, python-multipart, uvicorn, fastapi-cli, email-validator, pydantic-settings, pydantic-extra-types) but does not mention 'fastar'. Because the documented recommended install command is pip install "fastapi[standard]", every user following the official documentation silently pulls the unrelated 'fastar' package onto their developer or CI machine. The name 'fastar' is a typosquat-shaped substitution against 'fastapi'/'fastapi-*' namespaces, and its insertion into the canonical install path of one of PyPI's most-installed web frameworks constitutes a dependency-confusion / namespace-abuse vector regardless of what 'fastar' currently contains. Whoever controls 'fastar' on PyPI gains code execution at install time on a very large user base.

Affected versions

PyPI

PackageVulnerableFixed in
fastapi 1 listed versions No fix yet

How to fix

No fixed version has been published yet. Until one is, remove or replace the package, or turn off or isolate the affected feature. This page updates when a fix ships.

References

Timeline

  1. Published
  2. Withdrawn
  3. Last updated by the source
AdvisorySeverityWhy it's related
PYSEC-2024-38
python-multipart vulnerable to Content-Type Header ReDoS
High Also affects fastapi
GHSA-8h2j-cgx8-6xv7
Cross-Site Request Forgery (CSRF) in FastAPI
High Also affects fastapi

Credits: Amazon Inspector

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor