Malicious Code Vulnerability in Marshmellow Package
Summary
MAL-2026-864: Malicious code in marshmellow (PyPI). Affects marshmellow versions 1.0.0 – 1.1.0. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
Marshmellow is a Python package available on PyPI, primarily used for data serialization and deserialization. It is designed to simplify the process of converting complex data types, such as objects, into JSON-compatible formats and vice versa. However, the package has been identified as a target for typosquatting and dependency confusion, making it susceptible to malicious exploitation.
Vulnerability Detail
The vulnerability stems from a malicious version of the Marshmellow package that overrides the install command in its setup.py file to execute harmful code during installation. This type of attack is categorized as typosquatting, where an attacker creates a package with a name similar to a legitimate one to deceive users. The potential ramifications include unauthorized access to the system, data corruption, or other malicious activities, especially since the malicious code executes upon installation.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
pip uninstall marshmellow
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 workaround, users can avoid installing the Marshmellow package from untrusted sources or use alternative libraries that provide similar functionality without the associated risks.
Conclusion
The Marshmellow package has been compromised through a malicious version that executes harmful code during installation. Users are advised to update to a safe version and be vigilant about the sources from which they install packages. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for marshmellow →
FAQ
Typosquatting is a malicious practice where attackers create packages with names similar to popular packages to trick users into installing them.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
If you have installed the malicious version, immediately uninstall it using pip uninstall marshmellow and then install the legitimate version.
Always verify the package name, source, and version on PyPI or trusted repositories before installation.
Using compromised packages can lead to data breaches, system compromise, and other malicious activities that can harm your application and infrastructure.