From 8e4bbd7e4aa4946c04f752d6a13d4fb3c7685080 Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Sat, 16 May 2026 09:07:26 +0900 Subject: [PATCH] ci: declare workflow-level contents: read on 2 workflows Pins the default GITHUB_TOKEN to contents: read on workflows that don't call a GitHub API beyond the initial checkout. Other workflows that need write scopes are left implicit for a maintainer to declare. Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow caps bound runtime authority irrespective of repo or org default, give drift protection, and are credited per-file by the OpenSSF Scorecard Token-Permissions check. YAML validated locally with yaml.safe_load. Signed-off-by: Arpit Jain --- .github/workflows/format-check.yml | 3 +++ .github/workflows/static-analysis.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml index 243ad40..52ee2fa 100644 --- a/.github/workflows/format-check.yml +++ b/.github/workflows/format-check.yml @@ -13,6 +13,9 @@ on: - synchronize workflow_dispatch: +permissions: + contents: read + jobs: format-check: name: Run format check diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 37ba491..6203e64 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -12,6 +12,9 @@ on: - synchronize workflow_dispatch: +permissions: + contents: read + jobs: static-analysis: