Tsd1588

Supply Chain Attack on Elementary Data: How a GitHub Actions Flaw Led to Malicious PyPI Package

Published: 2026-05-01 10:24:06 | Category: Open Source

The open-source ecosystem has become an increasingly attractive target for cybercriminals, who exploit the trust and distribution channels of popular projects. A recent incident involving Elementary Data, an Israeli data observability startup, highlights the dangers of misconfigured CI/CD pipelines. Attackers managed to compromise a GitHub Actions workflow to push a malicious version of the elementary-data Python CLI to PyPI, potentially affecting thousands of users before detection.

This article breaks down how the attack unfolded, who was impacted, and the steps you need to take if you installed the compromised package. We also examine the broader lesson learned about securing automation workflows.

How the Attack Unfolded

The breach originated from a critical vulnerability in one of Elementary's GitHub Actions workflows. The workflow was configured to accept text from pull request comments and pass it directly into a shell command. This essentially gave anyone who could comment on a PR the ability to execute arbitrary code within the runner environment.

Supply Chain Attack on Elementary Data: How a GitHub Actions Flaw Led to Malicious PyPI Package
Source: itsfoss.com

On April 24 at 22:10 UTC, an attacker posted a malicious comment on a legitimate pull request. The workflow interpreted the comment as code, granting the attacker access to the runner's secrets, including the PyPI publish token and the GITHUB_TOKEN. With these credentials, the attacker created new branches and pull requests to stage what appeared to be a routine release.

Within ten minutes—by 22:20 UTC—the attacker had triggered the official release workflow, and elementary-data version 0.23.3 was published to PyPI. Four minutes later, a malicious Docker image was pushed to the registry. The entire attack took less than 20 minutes from initial comment to live package.

Impact and Affected Users

Only users who installed elementary-data 0.23.3 from PyPI or pulled the corresponding Docker image during the attack window are at risk. However, the consequences for those users are serious: the malware had full access to the runtime environment, meaning any credentials or data accessible to that environment could be compromised.

Notably, the following remain unaffected:

  • Elementary Cloud (SaaS product)
  • The Elementary dbt package
  • All other versions of the CLI (both earlier and later)

If you are running version 0.17.0 through 0.23.2, you are safe. The attack was narrowly scoped to one release.

Remediation Steps for Affected Users

If you suspect you may have installed the malicious package, follow these steps immediately. Use pip to check your installed version:

1. Check Your Installed Version

pip show elementary-data | grep Version

If the output shows 0.23.3, proceed to the next step.

2. Remove the Compromised Package

pip uninstall elementary-data
pip install elementary-data==0.23.4

Update your requirements.txt, Pipfile, or other dependency files to reflect version 0.23.4 as the minimum required.

3. Check for the Attacker's Marker File

The malware leaves behind a marker file if it executed. Its presence indicates the payload ran on that machine:

  • Linux/macOS: /tmp/.trinny-security-update
  • Windows: %TEMP%\.trinny-security-update

If you find this file, treat the environment as fully compromised.

4. Rotate All Credentials and Investigate

If the marker file exists or you have any reason to believe the payload executed, you must:

Supply Chain Attack on Elementary Data: How a GitHub Actions Flaw Led to Malicious PyPI Package
Source: itsfoss.com
  1. Rotate every API key, token, password, and secret that the affected environment could access.
  2. Engage your security team to audit logs for suspicious activity involving those credentials.
  3. Consider monitoring for data exfiltration or lateral movement.

How Elementary Responded

Elementary acted quickly after discovering the breach. On April 25, they:

  • Removed version 0.23.3 from PyPI, GitHub, and Docker Hub.
  • Decommissioned the vulnerable GitHub Actions workflow to prevent further exploitation.
  • Audited all other workflows for the same injection vulnerability.
  • Regenerated all exposed secrets and tokens.
  • Migrated to OIDC authentication for publishing to PyPI and other services, reducing reliance on long-lived secrets.

They are now working with an Israeli cybersecurity firm to conduct a full investigation and strengthen their overall security posture.

Key Takeaways for Developers and Maintainers

This incident is a stark reminder that CI/CD pipelines are as critical to security as application code. A single misconfigured workflow can undo months of careful code review. Best practices include:

  • Never pass untrusted input (like PR comments) directly into shell commands.
  • Use principle of least privilege for workflow tokens (GITHUB_TOKEN should be read-only by default).
  • Adopt OpenID Connect (OIDC) to eliminate static publish tokens.
  • Regularly audit workflows for injection points and unexpected triggers.

The open-source community depends on trust, but trust must be backed by secure engineering. If you maintain a project, consider setting up a security.txt file and a clear disclosure process.

For users, always verify checksums or signatures when installing packages, and keep an eye on project announcements for security advisories.

Conclusion

The compromise of Elementary Data's Python CLI is a classic supply chain attack enabled by a simple CI/CD misconfiguration. While the damage was limited to a single version, the incident underscores how quickly an attacker can go from a PR comment to a live malicious package. Thanks to prompt action from Elementary, the vulnerable version was pulled within hours, and the community has clear guidance on remediation.

Staying safe in the open-source ecosystem requires vigilance from both maintainers and users. By following the cleanup steps above and adopting more secure CI/CD practices, you can reduce the risk of falling victim to similar attacks.