Skip to content

GitHub Actions: Consider hardening setup against CVE-2020-15228 #1246

Closed

Description

@lukpueh

Description of issue or feature request:
#1242 added a GitHub Actions based CI workflow . GitHub Actions has a moderate injection vulnerability (CVE-2020-15228) against which we should consider hardening our setup.

Current behavior:
No particular hardening against CVE-2020-15228

Expected behavior:
Assess necessity and harden against CVE-2020-15228.

@jku proposes a strategy in #1195 (comment) also described in https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Activity

  1. changed the title [-]GitHubAction: Consider hardening setup against CVE-2020-15228[/-] [+]GitHub Actions: Consider hardening setup against CVE-2020-15228[/+] on Dec 17, 2020
  2. joshuagl commented on Dec 17, 2020

    @joshuagl
    Member

    Additional hardening we might consider is in the actions we use.

    AFAICT an Action release on the marketplace corresponds to a tag in the repository that publishes the action, which leaves users open to malicious maintainer attacks - tags are not immutable, so a repo owner (or attacker) can replace the tag and point to a malicious version of the action.

    GitHub allows us to restrict actions to either: only use actions defined in our org, only allow a predefined list of actions, or allow all actions.

  3. lukpueh commented on Dec 18, 2020

    @lukpueh
    MemberAuthor

    Good observation, @joshuagl! Here are some ideas to reduce the attack surface:

    • use the commit sha instead of the tag (with the downside of pinning full versions, whereas with tags you can also pin major or minor only)
    • allow only actions created/hosted by GitHub (and maybe popular verified 3rd-party actions)
    • try to use custom shell scripts on the run: keyword instead of non-verified 3rd-party actions where feasible
  4. trishankatdatadog commented on Dec 18, 2020

    @trishankatdatadog
    Contributor

    You guys are really thinking this through. Very impressive! 👏🏽

  5. joshuagl commented on Jan 5, 2021

    @joshuagl
    Member

    Another reason to distrust 3rd-party Actions – they can push commits (and tags?) to the repository[1].

    Furthermore, possibly due to the underlying shared object storage of GitHub, it seems that git activity on forks may have unintended consequences on the forked repo. So far as I can tell, this is not yet confirmed, but the Caddy Web Server seems to have had a release made – and pushed to the Go module proxy – by a tag being pushed to a fork of their repo[2].

  6. joshuagl commented on Feb 9, 2021

    @joshuagl
    Member

    GitHub's Security Lab have published some research and recommendations on securing GitHub Actions workflows:

    Haven't had chance to dig into this at all, but found an experiment in "Verifiable GitHub Actions" verifyme

  7. jku commented on Nov 4, 2021

    @jku
    Member

    I'd like to close this:

    • the specific issue that started it has been fixed by github (add-path and set-env commands no longer exist)
    • I've spent time looking at Github actions and have come up with two minor improvements: github actions: set workflow permissions to read-only #1662 and GH actions: limit GitHub token visibility #1652. otherwise the setup seems solid to me
    • using tags for actions does sound a little fishy -- but for the official github actions it seems reasonable: we've made the decision to trust github so we trust their tags to point to right places as well
    • verifying the build environment and making it auditable sounds potentially interesting but I think it should not be handled in this issue: please file specific issues if you think there's something we should do

    That leaves us with (I think) just some configuration, like allow only actions created/hosted by GitHub: I think this makes sense since we currently only use githubs own actions (and should have a high bar for using actions made by others). Would one of the org admins like to make that call and maybe flick the switch in settings?

  8. lukpueh commented on Nov 4, 2021

    @lukpueh
    MemberAuthor

    Would one of the org admins like to make that call and maybe flick the switch in settings?

    Done!

    Thanks for the research and for creating two more specific issues. Closing..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions