Skip to content

feat: exclude missing workflow permissions #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2025

Conversation

zhongliang02
Copy link
Contributor

@zhongliang02 zhongliang02 commented May 7, 2025

Context

This repo contains a custom codeql config which is used by some repos in their workflows.

We note that there are many CodeQL alerts generated due to 'Workflow does not contain permission'.
This rule is generally a best practice, rather than a currently exploitable vulnerability, since it requires an attacker to get an access token from a workflow created before February 2023, two prerequisites that are quite hard to achieve.

To get this access token, the attacker needs to get access to the pipeline, but by then, there are far bigger concerns e.g. leaking GH secrets.

The only other scenario is where the access token is accidentally leaked to the attacker, which is possible by supply chain attacks or somehow accidentally bundling it into the build artifact.

The probability of such a scenario seems quite slim, especially now that we enforce Github Action pinning, so it would have to be through build scripts and deps.

FYI, there are 77/613 active repos with workflows that created before February 2023.

Approach

This PR adjusts the CodeQL config to exclude the rule actions/missing-workflow-permissions

Risks

We risk the scenario where the access token is accidentally leaked to an attacker, where he will then be able to write to the repo, possibly including dumping the repo's secrets and org's secrets, or initiating a supply chain attack internally.

@zhongliang02 zhongliang02 requested a review from spaceraccoon May 7, 2025 06:41
@spaceraccoon spaceraccoon merged commit 1e045cb into develop May 7, 2025
2 checks passed
@spaceraccoon spaceraccoon deleted the feat/exclude-missing-workflow-permissions branch May 7, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants