Beware of Malicious PyPI Packages: How Typos Turn Into Crypto‑Mining Malware
A simple typo when using pip can install a malicious PyPI package that hides cryptomining code, and security researchers have uncovered dozens of such deceptive packages, highlighting the supply‑chain risks of Python's package ecosystem and offering practical mitigation steps.
Malicious PyPI Packages
Installing Python software via PyPI is convenient, but a simple typo can pull a malicious package. For example, running pip install openvc installs the malicious openvc package instead of the intended opencv.
Security firm Sonatype reports that many malicious packages masquerade as popular PyPI libraries, differing by only a few characters, and often embed cryptomining code.
Mining Software Disguised as Popular Libraries
Common plotting library matplotlib has several look‑alike malicious packages such as mplatlib , maratlib , and others uploaded by the user nedog123 . In total, seven impostor packages have been identified.
These packages depend on each other; for instance, learninglib depends on maratlib. Some hide dependencies, e.g., mplatlib disguises its dependency as “LKEK”.
Deep Obfuscation and Cryptomining Payloads
Analysis of maratlib 1.0 shows heavy obfuscation, making it hard to see the hidden code. Version 0.6 reveals that it downloads and executes a Bash script from GitHub, which in turn fetches the cryptominer “Ubqminer” and includes the attacker’s wallet address.
PyPI has removed these packages, but they have already been downloaded more than 5,000 times.
Why PyPI Supply‑Chain Risks Matter
These incidents are only the tip of the iceberg. Earlier attacks in 2016 used similar naming tricks, affecting 1.7 k developers and running 45 k times, even compromising U.S. military systems.
To mitigate risk, monitor the behavior of setup.py, install suspicious packages inside isolated containers, and capture system calls and network traffic. The same caution applies to other package managers such as npm and gem.
References: Sonatype blog, Ars Technica, Freebuf, GitHub repository.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
