Link to this headingGithub Actions
How well do you know GitHub Actions?
Leaking Secrets From GitHub Actions
Anyone can Access Deleted and Private Repository Data on GitHub
Vulnerable GitHub Actions Workflows Part 2: Actions That Open the Door to CI/CD Pipeline Attacks
Sensitive Files:
.github/workflows
Checklist:
- Test Code that was gotten from a third party
- Check to see if
pull_request_targetis used since it gives access to secrets from the malicious forked repo- If used then check what is done and see if it can be replaced with
pull_request
- If used then check what is done and see if it can be replaced with
- Check to see if
workflow_runis used since they can be triggered by attackers - Check to see if
issue_commentis used since it can be triggered by any comment
Link to this headingPermissions
Github API Permission Endpoints:
Get allowed actions for a specific Bearer token
Get the list of repositories for a specific Bearer token
Get default workflow permissions for a specific organization
Link to this headingCreate New Repo
Leads to a compromised GitHub
Link to this headingWrite Privileges
Leads to a compromised GitHub
Link to this headingSSH Keys
Link to this headingGPG Keys
Link to this headingUser Token
Example Auth using a user token
Link to this headingBypass Environments Protections
If you can make a new branch or push code to a branch you can run a github action that will interact will all branches including the protected branch
Link to this headingPoC Git hub actions
List Secrets:
Reverse Shell:
Link to this headingScript injections
Untrusted User Controlled Input:
github.event.issue.title:github.event.pull_request.title:github.event.pull_request.body:github.event.issue.body:github.event.comment.body:github.event.review.body:github.event.pages.*.page_name:github.event.commits.*.message:github.event.head_commit.message:github.event.head_commit.author.email:github.event.head_commit.author.name:github.event.commits.*.author.email:github.event.commits.*.author.name:github.event.pull_request.head.ref:github.event.pull_request.head.label:github.event.pull_request.head.repo.default_branch:github.head_ref:
Link to this headingScanners
Link to this headingzizmor
Scan actions for
Link to this headingPinning Versions
You can pin versions to limit exposure to supply chain attacks but that does not mean that the action you are using has also pinned their dependencies for the action