π Automated scanner for detecting and mitigating the tj-actions/changed-files
GitHub Actions supply chain attack.
This script scans all affected repositories and workflows in an organization, detects potential leaked secrets, and helps teams mitigate risks efficiently.
On March 15, 2025, the widely used GitHub Action tj-actions/changed-files
was compromised, leading to exfiltration of CI/CD secrets.
This tool automates the detection and cleanup process, making it easier for DevSecOps teams to respond quickly.
π More details on the attack
β
Finds all repositories in an organization using tj-actions/changed-files
.
β
Scans all affected workflows in those repositories.
β
Extracts logs of recent workflow runs.
β
Detects & decodes potential leaked secrets (Base64 double-encoded strings).
β
Logs findings for remediation.
git clone https://github.com/NaveRazy-Navina/github-tj-actions-changed-files-action-scanner.git
cd github-tj-actions-changed-files-action-scanner
You need a GitHub Personal Access Token (PAT) with repo and workflow permissions. Set up token:
export GITHUB_TOKEN="your_personal_access_token"
- in the file change org name to your
ORG="<<your org>>"
- then run the file
chmod +x fetch_github_logs.sh
./fetch_github_logs.sh
π The script will:
- Search for all affected repositories.
- Extract workflows using the vulnerable action.
- Download CI/CD logs and scan for leaked secrets.
- Save findings in GH_LOG.txt.
βΈ»
π Understanding the Output
- β No affected workflows found β Your org is safe.
β οΈ Possible leaked Base64 string found β Rotate affected secrets immediately.- β Error fetching logs β Check if GitHub API access is restricted.
π Findings are logged in:
GH_LOG.txt
βΈ»
π‘οΈ Mitigation & Best Practices
π¨ If your CI/CD secrets were exposed, take these steps:
- Rotate all leaked credentials (GitHub tokens, AWS keys, DB credentials).
- Remove tj-actions/changed-files from workflows.
- Pin GitHub Actions to SHA hashes instead of version tags.
- Enable GitHubβs allow-list for Actions to restrict external actions.
βΈ»
π‘ Contributing
π¨βπ» Contributions are welcome!
- Found a bug? Open an issue.
- Want to add a feature? Fork and submit a PR.
π Security Researchers: Please follow responsible disclosure guidelines.
βΈ»
π License
π MIT License - Free to use and improve.
π’ Spread the word to help secure more CI/CD pipelines! π