-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Pretty sure this repo got hacked and if you use this it will send your secrets to a hacker #2464
Comments
Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience. |
I had created an issue for this incident here: #2463 |
Ping @jackton1 Please add 2FA to your account! |
fwiw, it doesn't appear to send/push the secrets anywhere, but rather print the secrets to the logs in a double base64 encoded string, and then the hacker/anyone can scan the publicly available GHA runner logs of the job runs. So public repos are most at risk it seems. |
Private repos should still not use this action until there is an all clear. This is either:
In both cases, the actor responsible can trivially update the backdoor to exfiltrate credentials too. |
@nikitastupin Can you delete that |
Every tag got pointed to this malicious commit: |
Report the repo as active malware so GitHub can disable it in the meantime. |
Done, thanks for the link, didn't know about that yet! For everyone else, please submit one too to stop this from spreading further, you can copy/paste this:
|
Does this only affect public repos, or is there an exploitable surface area in private repos, too? |
@bachya As of this moment it only prints secrets to the actions log in double base64 encoded format. So technically not exploitable in private repo's, but doesn't mean this couldn't be changed. |
This could be an issue in private repos (especially for organizations) if there are members who can view the private repo but do not have the same access level as the workflow token, or who do not have access to the same secrets as the workflow. This assumes you're pinned to the compromised commit, and not to a tag. If you've pinned a tag, assume that whoever did this may update it further to do other things. |
Seems like this isn't meant to be a malicious takeover. The author of the gist also made this: https://github.com/nikitastupin/pwnhub ("How GitHub Actions workflows can be hacked") |
The author of the gist likely has nothing to do with this, and somebody has taken their POC's and implemented them IRL. |
Anyone working on reverting the current compromised versions? |
I sent an email to the maintainers as per https://github.com/tj-actions/changed-files/security#public-vulnerability-disclosures but only got an automated response. |
This is also an issue if you have enabled dependabot for github actions and are using Edit: i.e., even if you have the commit sha pinned dependabot Update will replace it |
It already has. do a github wide search for the commit hash of the compromised tag and you can find a bunch of repos with the malicious hash. |
Hi everyone, Thank you for your patience and vigilance throughout this process. I’m happy to inform you that the issue with the Summary of Actions Taken:
Recommendations:To ensure the security of your workflows, we recommend the following:
If you have any further questions or concerns, please feel free to raise them here. I deeply appreciate the community’s support and understanding during this incident. Thank you |
Could you kindly explain how the attacker was able to push those new tags? |
Yes I think we are all very intrigued to know the RCA of this, for an action with over 22k public installs it would very good to be transparent here. |
why does this still exist though? can we really be sure to start using it again? |
@intrigus-lgtm @onedr0p This attack appears to have been conducted from a PAT token linked to @tj-actions-bot account to which "GitHub is not able to determine how this PAT was compromised." Account Security Enhancements
|
Can you explicitly state or link to the tag with the fix instead of saying to use the latest version please? Also, this is worth calling out in main README that everyone should update to an explicitly stated version or later. |
@jackton1 fwiw, we built Octo STS to eliminate our own usage of GitHub PATs for automation exactly like this in favor of federated trust relationships. Personally I'd love it if GitHub would just launch their own, so we don't have to run this, but if you'd have any interest in discussing it after the dust settles, feel free to reach out to me. My meta concern is that without knowing how the PAT leaked, there's no telling whether it will simply leak again by the same means. |
Hi @ppat, all tags have been restored and fixed, except for v45.0.5 through v45.0.9. These versions all point to the latest commit on main. |
HI @mattmoor, Thank you for sharing this, and I appreciate the suggestion regarding Octo STS. It’s an interesting approach to improving security for automation workflows, and I agree that having GitHub provide a similar solution natively would be ideal. Once things settle down, I’d be happy to discuss this further and learn more about your implementation. I completely understand the importance of identifying the root cause of the PAT leak to prevent recurrence. I’m actively working to investigate how the leak occurred and will take steps to ensure that the same vulnerability cannot be exploited again. |
You may also want to consider requiring only signed commits to this repo. |
@mceachen Thank you for the suggestion! Requiring signed commits has been enabled which wasn’t initially required to ensure the integrity of all contributions. We’ll continue to monitor and enhance security measures as needed to prevent any future incidents. If you have any additional recommendations, feel free to share them. |
@jackton1 Do you know the scope of the secrets that could have been exposed? Workflow level? Repo level? Org level? Or just all secrets in the chain? |
@jackton1 Do you have proof that the access came from the PAT? If so, where was that PAT stored and how was it used? Presumably, since it's your bot, you're the only one with access to the PAT, correct? Regardless of the PAT though, it seems clear in the PR logs that the commits were pushed from your own account, not from the @tj-actions-bot account: ![]() |
This is not reassuring that you don’t know how the PAT was compromised… makes me think it’ll just happen again. |
The author of the commit is clearly misleading see the details of commit here: #2463 (comment) How the PAT was obtained unfortunately "GitHub is not able to determine how this PAT was compromised." |
The Personal access token affected was stored as a GitHub action secret which has since been revoked. Going forward no PAT would be used for all projects in the tj-actions organization to prevent any risk of reoccurrence. We’ll continue to monitor and enhance security measures as needed to prevent any future incidents. If you have any additional recommendations, feel free to share them. |
Is there an existing issue for this?
Does this issue exist in the latest version?
Describe the bug?
See 0e58ed8. Has the following code:
Base 64 decoded it's:
Sending secrets to a GitHub gist.
To Reproduce
Use this action in GitHub Actions
What OS are you seeing the problem on?
windows-latest or windows-2022
Expected behavior?
No hacks
Relevant log output
Has all relevant logs been included?
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: