Malicious PyPI Packages Compromised Cloud Tokens—Over 14,100 Downloads Before Being Taken Down

Cybersecurity Alert: Malicious Python Packages Found on PyPI Targeting Sensitive Data

Cybersecurity experts have recently unveiled a malicious campaign aimed at users of the Python Package Index (PyPI), revealing a collection of fraudulent libraries disguised as tools related to time management. While these seemingly innocuous utilities may appear harmless, they contain hidden functionalities designed to exfiltrate sensitive data, including cloud access tokens.

ReversingLabs, a firm specializing in software supply chain security, reported the discovery of 20 packages that collectively amassed over 14,100 downloads. Among these packages are snapshot-photo, aclient-sdk, and time-check-server, with the latter receiving a notable 2,448 downloads. These libraries have been classified into two categories: the first group focuses on facilitating data uploads to the attackers’ infrastructure, while the second involves cloud client functionalities for prominent services, including Alibaba Cloud, Amazon Web Services, and Tencent Cloud.

Despite their utility, these “time” related packages have also played a critical role in the unauthorized exfiltration of cloud secrets. As of the current date, all identified packages have been removed from the PyPI repository to mitigate further risks.

Further investigation has linked three specific packages—acloud-client, enumer-iam, and tcloud-python-test—to a well-known GitHub project, accesskey_tools, which has gained significant traction in the developer community, being forked 42 times and receiving 519 stars. This suggests a concerning foothold for malicious actors within popular code repositories.

Documentation indicates that the tcloud-python-test package has been available for download since November 8, 2023, with it being downloaded 793 times according to analytics from pepy.tech. The timing of this discovery coincides with another report from Fortinet FortiGuard Labs, which identified thousands of packages across both the PyPI and npm ecosystems embedding potentially harmful install scripts.

Jenna Wang from Fortinet highlighted the importance of scrutinizing external URLs tied to package dependencies, as such links often serve as conduits for downloading additional malicious payloads or establishing communications with command-and-control servers, which are critical for an attacker’s operational effectiveness.

The tactics employed in this campaign can be mapped to the MITRE ATT&CK framework, particularly focusing on initial access and data exfiltration methods. The use of bogus libraries for data theft aligns with techniques aimed at establishing persistence, allowing attackers to maintain control over compromised systems.

As threats evolve and become more sophisticated, maintaining vigilance in monitoring package dependencies is paramount for organizations. This incident serves as a reminder for business owners to assess their cybersecurity protocols and ensure robust frameworks are in place to counteract potential vulnerabilities.

The current landscape of cyber threats requires ongoing education and adaptation. As the community continues to adapt to threats like these, the focus should remain on mitigation and prevention through awareness and enhanced security measures.

Source link