Malicious packages deepseeek and deepseekai published in Python Package Index

Introduction

As part of our threat research and monitoring efforts, the Supply Chain Security team of the Threat Intelligence department of the Positive Technologies Expert Security Center (PT ESC) detected and prevented a malicious campaign in the Python Package Index (PyPI) package repository. The attack targeted developers, ML engineers, and ordinary AI enthusiasts who might be interested in integrating DeepSeek into their systems.

PyPI is used as a default package repository in popular package managers: pip, pipenv, and poetry.

Attack chain

On January 29, 2025, a malicious user bvk (an account that was created in June 2023 with no other activity) uploaded two packages: deepseeek and deepseekai.

bvk account page (Vamsi)
Figure 1. bvk account page (Vamsi)

Functions used in these packages are designed to collect user and computer data and steal environment variables. The payload is executed when the user runs the commands deepseeek or deepseekai (depending on the package) in the command-line interface. Environment variables often contain sensitive data required for applications to run, for example, API keys for the S3 storage service, database credentials, and permissions to access other infrastructure resources.

deepseekai console command registered in the package of the same name
Figure 2. deepseekai console command registered in the package of the same name
Malicious payload used in the packages
Figure 3. Malicious payload used in the packages

The author of the two packages used Pipedream, an integration platform for developers, as the command-and-control server that receives stolen data. 

It's worth mentioning that the script was written with the help of an AI assistant, which is indicated by the characteristic comments explaining the lines of code.

We have promptly notified the PyPI administrators about the packages, which are now deleted. Despite the immediate response, the package was downloaded 36 times using the pip package manager and the bandersnatch mirroring tool and 186 times using the browser, the requests library, and other tools.

deepseekai project, now quarantined
Figure 4. deepseekai project, now quarantined

Attack timeline (UTC+0):

January 29, 2025, 15:52:58The deepseeek 0.0.8 package is first published
January 29, 2025, 16:13:10The deepseekai 0.0.8 package is first published
January 29, 2025, 16:21:32Based on our report, both packages are quarantined and unavailable for download using package managers
January 29, 2025, 16:41:14The PyPI administrators delete the deepseeek package and notify us accordingly
January 29, 2025, 16:42:01The PyPI administrators delete the deepseeek package and notify us accordingly

List of downloads (according to PyPI):

CountryDownload methodCount
The U.S.Browser33
requests19
pip8
bandersnatch2
Other55
Chinabandersnatch8
pip6
Browser4
Other18
RussiaBrowser3
requests1
Other8
Hong Kongpip4
Browser4
bandersnatch2
requests1
Germanybandersnatch4
requests4
Browser2
CanadaBrowser3
requests2
Switzerlandrequests3
Browser2
CroatiaBrowser4
Swedenrequests4
PolandBrowser2
The UKBrowser2
IrelandOther2
NorwayBrowser2
Singaporebandersnatch2
Francerequests2
UkraineBrowser1
Saudi ArabiaBrowser1

Conclusion

Cybercriminals always monitor the current trends and will try to take advantage of them at the right moment. In this case, we analyzed a relatively harmless attack, although due to the hype around DeepSeek, there could be a lot more victims if the malicious package activity stayed hidden for longer.

The packages were identified by the service for detecting suspicious and malicious Python packages PT PyAnalysis. The service monitors packages published by PyPI users for signs of malicious activity in real time.

We recommend being careful with newly released packages that pose as wrappers for popular services.

IOCs

IoCType
deepseeekPyPI package
deepseekaiPyPI package
eoyyiyqubj7mquj.m.pipedream.netC2
Share this article:

Get in touch

Fill in the form and our specialists
will contact you shortly