Security News

Phishing Attacks Targeting Python Package Repository (PyPI) Users Detected

In PyPI, it has been detected that phishing attacks targeting project developers have been carried out by injecting malicious code into Python packages.

Brandefense logo Updated 3 Min Read
Phishing Attacks Targeting Python Package Repository (PyPI) Users Detected

Phishing attacks have targeted developers who publish Python packages on PyPI. Attackers sent urgent security emails that led to a fake PyPI login page and captured account details. They then used the stolen logins to add malicious code to packages. This matters to anyone who publishes or installs Python packages.

In PyPI, a software repository for the Python programming language, it has been detected that phishing attacks targeting project developers have been carried out by injecting malicious code into Python packages by threat actors. These phishing attacks aim to capture software developers’ identity information.

How does the PyPI phishing attack work?

The attack vector begins when threat actors send phishing e-mails to developers expressing security-related urgency. Then, by clicking on the URL link in the e-mail text, the developers are directed to a phishing page created by imitating the user login page of the PyPI platform. With the members’ login by providing their information, this login information is captured by the threat actors. Then, the threat actors log into the PyPI platform with the login information of the developers and inject malicious code into the Python packages included in it.
How the PyPI phishing attack works
  1. Urgent e-mailDevelopers receive a message that expresses security-related urgency
  2. Fake login pageThe link leads to a page imitating the PyPI login
  3. Credentials capturedDevelopers enter their details and the threat actors take them
  4. Packages poisonedThe attackers log in and inject malicious code into the developers’ packages
It has been observed that malicious software created for users to download to their systems is larger in size due to its detection evasion features and a valid signature. It has been announced that the affected accounts on the PyPI platform are temporarily frozen, and the affected “Exotel” and “Spam” packages have been removed. Attack campaigns that manipulate open source platforms and target software developers are increasing day by day.

How can developers protect themselves from phishing?

In order not to be the target of similar attacks that may be carried out in this context, it is recommended to implement the security steps given below.
  • Developers at risk of being hacked should reset their passwords and 2FA recovery codes.
  • E-mails, attachments, or links from suspicious and unknown parties should not be opened.
  • Beware of unreliable content.
  • Comprehensive security solutions should be used.
  • Detected IoC findings related to the attack campaign should be blocked by the security solutions.
In addition, it is recommended to verify that the URL in the address bar is http://pypi.org and that the TLS certificate of the site is http://pypi.org to verify that you are not using your credentials on the phishing page.

Frequently Asked Questions.

What is the PyPI phishing attack?

Threat actors emailed PyPI developers with a security-themed warning. The link led to a fake PyPI login page that captured their credentials, which were then used to inject malicious code into Python packages.

Which packages were removed after the PyPI phishing attack?

The post names the Exotel and Spam packages as removed. A news report quoting PyPI also lists a malicious deep-translator release and says several hundred lookalike package names were taken down.

What should a developer do after entering PyPI details on a phishing page?

Reset the password and the 2FA recovery codes, then check the account for activity you did not do.

How can I tell I am on the real PyPI login page?

Check that the address bar shows pypi.org and that the site certificate matches. Be wary of links in unexpected emails.

Sources

  1. 1 Phishing PyPI users: Attackers compromise legitimate projects to push malware (Help Net Security)
  2. 2 CISA: Avoiding Social Engineering and Phishing Attacks
  3. 3 MITRE ATT&CK T1566 Phishing

Try it on your own domain

Type a domain to see the kinds of imitations an attacker would consider.

Generated in your browser, nothing is sent.

    Check a domain with the free scanner

    Share