A Python tool for data analysis that worked half the day turned malicious: it stole keys and tokens.

A Python tool for data analysis that worked half the day turned malicious: it stole keys and tokens.

40 hardware

A cybercriminal uploaded a malicious version of the elementary-data package to PyPI

An unknown attacker uploaded a modified 0.23.3 build of the *elementary-data* utility – a data monitoring tool – to the PyPI repository. The malicious package collected and sent confidential information to a remote server: SSH keys, AWS credentials, API tokens, as well as cryptocurrency wallet files (Bitcoin, Litecoin, Dogecoin, Ethereum). The gathered data were packaged into a `trin.tar.gz` archive and transmitted to the attacker.

How access was obtained to the repository

The assailant exploited a vulnerability in one of the GitHub Actions workflows for the *elementary-data* project. By automatically receiving a `GITHUB_TOKEN`, he created a pull request that replaced the original package with the malicious version. Thanks to the automated workflow, the PR was merged and the infected release was published.

Duration of the malicious package’s presence

- April 25, 02:20 (MSK) – the attacker uploaded the malicious version to PyPI.
- 02:24 – he also posted an infected Docker image to GitHub Container Registry, expanding the attack surface.
- 13:45 that same day – project administrators removed all compromised files and released a clean 0.23.4.

Thus, the malicious package was available to users for more than 11 hours, giving a window for data leakage.

Affected components

Developers confirmed that other parts of the ecosystem – *Elementary dbt*, Elementary Cloud resources, and other project versions – were not impacted by the incident.

What users should do
1. Remove the infected 0.23.3 version and install the secure 0.23.4 release.
2. Clear the package cache (`pip cache purge` or a similar tool).
3. Delete the marker file `.trinny-security-update` if present – its presence indicates that malicious code was executed.

Measures taken by developers
- Updated the PyPI publication token.
- Reviewed and refreshed GitHub and GitHub Container Registry tokens.
- Removed the vulnerable workflow in GitHub Actions; other workflows were audited for security.

With these actions, the *elementary-data* team regained control of the repository and protected users from further threats.

Comments (0)

Share your thoughts — please be polite and stay on topic.

No comments yet. Leave a comment — share your opinion!

To leave a comment, please log in.

Log in to comment