Malicious Code Exfiltration in dify-api Package
Summary
MAL-2026-248: Malicious code in dify-api (PyPI). Affects dify-api versions 2.0.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
The dify-api package, available on PyPI, is designed for developers to integrate various functionalities into their applications. However, it has been identified as containing malicious code that exfiltrates sensitive information from the host system. This vulnerability poses a risk to users who unknowingly install the package, as it compromises their system's security.
Vulnerability Detail
The vulnerability originates from the package's design, which includes code that exfiltrates basic information such as the host's IP address and username. The malicious behavior is triggered during the installation process, as the package overrides the install command in setup.py to execute this code. This poses a limited risk but is still significant as it can lead to unauthorized access to user data.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
pip uninstall dify-api
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, users can avoid installing the dify-api package until a secure version is released. Additionally, consider using a virtual environment to isolate dependencies and reduce the risk of exposure to malicious packages.
Conclusion
The dify-api package has been identified as containing malicious code that can exfiltrate sensitive information from users' systems. It is crucial for developers to be aware of this vulnerability and take immediate action to protect their applications. Regularly updating packages and using tools like Vulert can help in maintaining security.
See every vulnerability recorded for dify-api →
FAQ
The dify-api package is a Python library available on PyPI, intended for developers to integrate various functionalities into their applications.
The malicious code in the dify-api package exfiltrates basic information such as the host's IP address and username.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If you have installed the dify-api package, you should uninstall it immediately and check for any updates or patches that may address the vulnerability.
Vulert monitors and alerts in real-time for open-source vulnerabilities in your software by using the Pipfile.lock, allowing you to stay informed about potential risks.