Skip to content

ci: set least-privilege permissions on workflow token#844

Merged
jmanico merged 1 commit into
OWASP:mainfrom
arpitjain099:chore/workflow-permissions
Jun 2, 2026
Merged

ci: set least-privilege permissions on workflow token#844
jmanico merged 1 commit into
OWASP:mainfrom
arpitjain099:chore/workflow-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

I work on software supply chain security and have been hardening GitHub Actions workflows across OSS projects.

Each of these workflows runs without a top-level permissions: block, so its GITHUB_TOKEN inherits the repository (or org) default, which is frequently read/write for all scopes. This PR sets permissions: contents: read at the workflow level for .github/workflows/markdown_linter.yml, .github/workflows/spell-check.yml, which is all these jobs need (checkout plus the build/test steps). Scoping the token to read-only shrinks what a compromised step or dependency can do, a concern made concrete by the March 2025 tj-actions/changed-files compromise (CVE-2025-30066), where a leaked write-scoped GITHUB_TOKEN was the blast radius.

No job behavior changes; the steps already only read the repository.

Set an explicit least-privilege permissions block so the workflow GITHUB_TOKEN is scoped to contents: read instead of inheriting the repository default.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@RicoKomenda
Copy link
Copy Markdown
Collaborator

As this is only a standard, we don't need to harden the CI imo. But thanks for thinking about it! :)

@RicoKomenda RicoKomenda closed this Jun 2, 2026
@jmanico jmanico reopened this Jun 2, 2026
@jmanico jmanico merged commit d60b9c9 into OWASP:main Jun 2, 2026
@jmanico
Copy link
Copy Markdown
Member

jmanico commented Jun 2, 2026

There are so many GitHub attacks and since I created the repo, the identity is under my name. I'm going to go for it and merge this nice addition in...

@arpitjain099
Copy link
Copy Markdown
Contributor Author

There are so many GitHub attacks and since I created the repo, the identity is under my name. I'm going to go for it and merge this nice addition in...

Thank you @jmanico

@jmanico
Copy link
Copy Markdown
Member

jmanico commented Jun 2, 2026

And a PS: @RicoKomenda meant well, we are desperately trying to avoid new automation.

But if any of these libraries get compromised by prompt injection type attacks, we're screwed. This helps. Thank you. :)

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.

3 participants