Malicious Code Injection in graphsync Package: A Security Threat
Summary
MAL-2025-192385: Malicious code in graphsync (PyPI). Affects graphsync versions 1.1.0 – 1.1.1. 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 graphsync package, available on PyPI, is designed for handling graph synchronization tasks in Python applications. It is widely used for its efficiency and ease of integration. However, a recent discovery has revealed that certain versions of this package contain malicious code that poses significant security risks to users and their applications.
Vulnerability Detail
The vulnerability originates from a malicious copy of the graphsync package, which is actually a disguised version of the legitimate networkx package. This malicious version includes an obfuscated script that downloads and executes further scripts from various remote locations. The intent behind this malicious activity remains unclear, but it is suspected to involve data theft or other harmful actions. The obfuscation of the code makes it difficult for users to detect the malicious behavior, thereby increasing the risk of exploitation.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
pip uninstall graphsync
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 remove the graphsync package from their environment until a secure version is confirmed. This can be done using the command: pip uninstall graphsync. Additionally, consider using alternative packages that provide similar functionality without the associated risks.
Conclusion
The discovery of malicious code within the graphsync package highlights the importance of vigilance when using open-source software. Users are urged to update their packages promptly and utilize tools like Vulert to ensure their applications remain secure.
See every vulnerability recorded for graphsync →
FAQ
The malicious code is designed to download and execute scripts from remote locations, potentially leading to data theft or other harmful actions.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring any signup.
The affected versions of graphsync are 1.1.0 and 1.1.1, which contain the malicious code.
If you have installed the affected version, you should uninstall it immediately and update to the latest patched version of the package.
To prevent future vulnerabilities, regularly monitor your dependencies using tools like Vulert, and always verify the source of packages before installation.