It printed secrets in the build logs, which were then visible publicly.
Luckily we did not use that action, but it raised awareness on how they work: The version is just a tag in the actions repository, which can be moved to a different commit, making it an attack vector.
I wanted to bring up this topic and ask if we feel threatened enough by this to pin our GitHub actions to commits instead of tags, making such supply chain attacks way harder / not updating our action to the hijacked version. The donwside is worse readability, manual effort when update those actions.
I don’t want to raise the question if we trust the authors of these plugins enough to expose all of our build secrets to them (at least not in this thread), but concentrate on the question above.
Interesting question. Referring to a commit makes it really hard to tell which version is in use. At least I would leave a comment then which version tag is represented by the commit.
I would like to avoid this as much as possible, tend to trust all the above mentioned actions. Maybe we could say that at least the actions provided by GitHub are considered safe (all starting with actions/). Others are subject for discussion.
Actually, also a pinned commout does not grant safety, too. Do we really check that these actions are uncompromised? Actually not.
I agree in assuming that the official GitHub Actions should be considered safe. Also, most of the actions we used are used by a ton of projects and I would not assume that the creators will add something malicious itself (even if they could). As you said, we don’t check if the actions are uncompromised, we don’t check our other dependencies, too.
The repository is owned by a single person and used by 150k repositories. If an attacker compromised the persons account (we don’t even know if they use 2FA or their password ist “password!”), it would take one commit and moving one single tag to inject anything you want via supply chain attack into those 150k repositories.
Incentives for these attacks are high, the payoff is potentially high, and if the malicious commit is prepared, it takes ~10 seconds to publish it and change the version tag. Usually, systems for distributing software and dependencies have a lot more safeguards in place for a reason
This action would be an example where I think that it is worth to change it to to a commit and documenting the actual tag. Same for the action-junit-report, and maybe others, too.
And it makes me aware that we should introduce a review process to revise used or new actions. Can we maybe agree on the following
actions owned by github are considered safe
seperate actions can be considered safe after proper discussion (e.g. I would consider jreleaser as safe)
actions from personal github accounts are considered unsafe