As per the security policy, we are disclosing this vulnerability for the openebs/mayastor-control-plane repository.
Summary
For each workflow run, Github generates an API key called the GITHUB_TOKEN. This is meant for the workflow to be able to authenticate to the Github API and perform duties outlined in the workflow file (checking out the repo, modifying PRs, etc).
If developers are unaware of this and somehow publish contents of their working directory, it's possible for the GITHUB_TOKEN to leak. It should only be valid for the duration of the workflow run, but there is some wiggle room that can be exploited by someone with enough determination.
Details
The bdd.yml workflow file (called from nightly-ci.yml) uses actions/upload-artifact@v4 to upload the ci-report-bdd artifact. This artifact includes the run's GITHUB_TOKEN. Seeing as the artifact can be downloaded prior to the end of the workflow, there are multiple seconds where an attacker can extract the token from the artifact and use it with the Github API to push malicious code or rewrite release commits in your repository.
Given that the GITHUB_TOKEN for this workflow is highly permissioned, an attacker can accomplish multiple styles of attacks that compromise the integrity of the project. The permissions on the token are (taken from this run):
GITHUB_TOKEN Permissions
Actions: write
Attestations: write
Checks: write
Contents: write
Deployments: write
Discussions: write
Issues: write
Metadata: read
Models: read
Packages: write
Pages: write
PullRequests: write
RepositoryProjects: write
SecurityEvents: write
Statuses: write
The most dangerous ones are Contents: write and PullRequests: write. With these an attack can:
- Push code directly to any branch (assuming no branch protection rules)
- If branch protection rules exist, they can submit a PR and then approve it with the token, bypassing the protection rules.
Notes
This is likely to also affect the unit-int.yml workflow as it has the same logic for artifact creation.
As per the security policy, we are disclosing this vulnerability for the
openebs/mayastor-control-planerepository.Summary
For each workflow run, Github generates an API key called the GITHUB_TOKEN. This is meant for the workflow to be able to authenticate to the Github API and perform duties outlined in the workflow file (checking out the repo, modifying PRs, etc).
If developers are unaware of this and somehow publish contents of their working directory, it's possible for the GITHUB_TOKEN to leak. It should only be valid for the duration of the workflow run, but there is some wiggle room that can be exploited by someone with enough determination.
Details
The
bdd.ymlworkflow file (called fromnightly-ci.yml) uses actions/upload-artifact@v4 to upload theci-report-bddartifact. This artifact includes the run's GITHUB_TOKEN. Seeing as the artifact can be downloaded prior to the end of the workflow, there are multiple seconds where an attacker can extract the token from the artifact and use it with the Github API to push malicious code or rewrite release commits in your repository.Given that the GITHUB_TOKEN for this workflow is highly permissioned, an attacker can accomplish multiple styles of attacks that compromise the integrity of the project. The permissions on the token are (taken from this run):
The most dangerous ones are
Contents: writeandPullRequests: write. With these an attack can:Notes
This is likely to also affect the
unit-int.ymlworkflow as it has the same logic for artifact creation.