Malicious Code Injection in FastPI Package - Security Alert

fastpi Updated 31 Jan 2026

Summary

30/01/2026
CRITICAL
No i
Critical
Not published

MAL-2026-613: Malicious code in fastpi (PyPI). Affects fastpi versions 0.128.0 – 0.128.2. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

FastPI is a popular web framework for building APIs with Python, known for its speed and ease of use. It allows developers to create robust applications quickly. However, a malicious version of FastPI has been identified, which poses significant security risks to users who may inadvertently install it.

Vulnerability Detail

The vulnerability originates from a malicious copy of the legitimate FastAPI package, uploaded by a user named kam193. This compromised version includes encrypted and obfuscated code that is likely designed to perform harmful actions, such as data theft or unauthorized access. The exact behavior of the malicious code remains unknown, but its obfuscation and the method of delivery raise serious concerns about the integrity of the software.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

pip uninstall fastpi

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary measure, avoid using the FastPI package and ensure that your application dependencies are sourced from trusted repositories. Regularly check for updates and security advisories related to your dependencies.

Conclusion

The discovery of a malicious version of the FastPI package highlights the importance of vigilance when managing software dependencies. Users are urged to uninstall the compromised package and switch to the legitimate FastAPI to ensure their applications remain secure.

See every vulnerability recorded for fastpi →

Share this vulnerability

FAQ

FastPI is a Python web framework designed for building APIs quickly and efficiently, leveraging modern Python features.

Check your installed packages using 'pip list' and verify the package name. If you see 'fastpi', you may have the malicious version.

Immediately uninstall the package using 'pip uninstall fastpi' and install the legitimate FastAPI package with 'pip install fastapi'.

Always verify package sources and consider using tools like Vulert to monitor your dependencies for vulnerabilities.

Vulert is a service that monitors open-source vulnerabilities in your software using just the Pipfile.lock. You can check your application for vulnerabilities in real-time without any installation.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

pip uninstall fastpi

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback