Skip to content

ci: declare contents:read on Java CI workflow#321

Closed
arpitjain099 wants to merge 1 commit into
spotify:mainfrom
arpitjain099:chore/declare-workflow-perms
Closed

ci: declare contents:read on Java CI workflow#321
arpitjain099 wants to merge 1 commit into
spotify:mainfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown

Adds a workflow-level permissions: contents: read block to .github/workflows/ci-pull-request.yaml. The Java CI job only does checkout, JDK setup, and mvn verify; nothing here needs anything beyond read access to the repository.

The motivation is supply-chain blast-radius capping. CVE-2025-30066 (the March 2025 tj-actions/changed-files compromise) showed that a tampered third-party action can exfiltrate GITHUB_TOKEN via the workflow logs, and the leaked token retains whatever scope it was issued with. Pinning the workflow token to contents: read bounds that runtime authority. The repo default may already be read-only, but an in-file declaration adds drift protection (a future change to the org or repo default can't silently widen this workflow) and lights up OpenSSF Scorecard's Token-Permissions check, which only counts explicit per-workflow declarations.

YAML validated locally with yaml.safe_load.

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

Thanks for the contribution and for flagging the permissions hardening — we appreciate the security awareness!

We'll look into this and handle it internally. For future contributions to this repo, please refer to our contribution guidelines.

@nicklasl nicklasl closed this May 19, 2026
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