Cybersecurity researchers have identified a supply chain attack targeting the tj-actions/changed-files GitHub Action, widely used in over 23,000 repositories to track file changes in CI/CD workflows. Attackers compromised the Action’s code, retroactively updating version tags to reference malicious commits. This modification led to the exposure of sensitive CI/CD secrets, such as AWS access keys, GitHub Personal Access Tokens, npm tokens, and private RSA keys, through publicly accessible build logs. However, there’s no evidence that the leaked secrets were exfiltrated to attacker-controlled infrastructure.
The malicious code executed a Python script hosted on a GitHub gist, designed to extract CI/CD secrets from the Runner Worker process.
The compromised Action affected all versions, as attackers managed to modify existing version tags to point to the malicious code. GitHub responded by removing the compromised Action, restoring it after confirming the removal of malicious changes and securing the source of the compromise. Users are advised to update to the latest version (46.0.1) and review workflows executed between March 14 and March 15 for unexpected outputs.
This incident underscores the growing risk of supply chain attacks in CI/CD environments, highlighting vulnerabilities in widely used open-source components. The attack exemplifies how compromised dependencies can lead to widespread exposure of sensitive data across numerous organizations. It also emphasizes the need for robust security measures, such as auditing dependencies, implementing strict access controls, and monitoring build logs for unusual activities.
Developers should exercise caution when integrating third-party Actions or packages into their workflows, ensuring they are sourced from trusted maintainers and regularly updated.
In response to the attack, the maintainers of tj-actions/changed-files reported that the threat actor gained access through a compromised GitHub personal access token (PAT) used by a bot with privileged access. Following the incident, the bot’s password was updated, authentication was enhanced to use a passkey, and permissions were adjusted to adhere to the principle of least privilege. GitHub also revoked the compromised PAT. This event serves as a cautionary tale for organizations to continuously assess and enhance the security of their CI/CD pipelines and associated dependencies.