Skip to content

Leaking of High Permission GITHUB_TOKEN in Workflow Artifact for openebs/mayastor-control-plane Repository

Critical
pchandra19 published GHSA-w4f2-8vv5-2338 May 14, 2025

Package

actions bdd.yml (GitHub Actions)

Affected versions

all

Patched versions

None

Description

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.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

CVE ID

No known CVE

Weaknesses

No CWEs

Credits