Critical Malicious Code Vulnerability in scrapetools2 Package
Summary
MAL-2026-17199: Malicious code in scrapetools2 (PyPI). Affects scrapetools2 versions 0.2.0 – 1.2.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 scrapetools2 package, available on PyPI, is designed for web scraping tasks, providing tools and utilities that facilitate the extraction of data from websites. However, it has been found to contain a significant security flaw that allows for the execution of arbitrary code, posing a serious risk to users who install it.
Vulnerability Detail
The vulnerability originates from an auto-update mechanism embedded in the downloader.py file of scrapetools2 version 1.2.1. This mechanism fetches payloads from public IPFS gateways controlled by the package author, using a mutable IPNS name. The fetched code is decrypted and executed in the user's environment, allowing an attacker to run arbitrary Python code on the installer's machine. The only integrity check is a Fernet key included in the package, making it susceptible to exploitation if the IPNS name is compromised.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
pip uninstall scrapetools2
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 using scrapetools2 until a patched version is released. Alternatively, consider using a different package for web scraping that does not have known vulnerabilities.
Conclusion
The scrapetools2 package contains a critical vulnerability that allows for the execution of arbitrary code through an insecure update mechanism. Users are advised to update their packages promptly and consider alternative solutions until a fix is released.
See every vulnerability recorded for scrapetools2 →
FAQ
The vulnerability allows for the execution of arbitrary code due to an insecure auto-update mechanism that fetches code from external sources.
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 scrapetools2, it is recommended to uninstall it and monitor for updates or switch to a different package until a fix is available.
To prevent similar vulnerabilities, always review package dependencies and their update mechanisms, and consider using tools like Vulert to monitor for vulnerabilities in real-time.
The consequences can include unauthorized access to sensitive data, system compromise, and the execution of malicious code, which can lead to further exploitation.