Skip to content
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

Prevention against this attack #3

Closed
ubiratansoares opened this issue Nov 13, 2024 · 2 comments
Closed

Prevention against this attack #3

ubiratansoares opened this issue Nov 13, 2024 · 2 comments

Comments

@ubiratansoares
Copy link

Hi Adnan, thank you so much for this PoC and the related blog post! Super interesting!

If I got everything from your findings, could we state that a general procedure to avoid being hit by a cache poisoning attack is never restoring caches from the main branch, regardless the Workflow?

In addition, is this a vulnerability only related to actions/restore provided by Github, or would it impact any other public GHA that build on top of common actions/toolkit building blocks (eg, https://github.com/gradle/actions/blob/main/setup-gradle/action.yml )?

Thanks in advance!

@AdnaneKhan
Copy link
Owner

Hi @ubiratansoares, the correct procedure for avoiding a cache poisoning attack is to never run untrusted/unreviewed code in the context of the default branch of a repository (typically main).

This technique applies to any action that builds on top of actions/toolkit. In particular the cache hit and unzip part of it.

@ubiratansoares
Copy link
Author

All right then! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants