Skip to content

Security: Add permissions: blocks to all GitHub Actions workflows to restrict GITHUB_TOKEN scope #286

Description

@LucasMaupin

Summary

None of the GitHub Actions workflow files in Eyevinn/intercom-manager declare an explicit permissions: block at the workflow or job level. Every workflow run therefore receives the GitHub-default GITHUB_TOKEN permissions, which include write access to contents, pull-requests, packages, and more — far broader than most jobs need.

The workflow_dispatch workflow (dispatch.yml) is the highest-risk: it only needs to trigger a repository dispatch event but implicitly holds write access to the entire repository.

Affected Files

  • .github/workflows/dispatch.yml
  • .github/workflows/lint.yml
  • .github/workflows/pretty.yml
  • .github/workflows/typescript.yml
  • .github/workflows/unittests.yml
  • .github/workflows/publish.yml
  • .github/workflows/development.yml
  • .github/workflows/release-notes.yml

Risk

If any workflow step is compromised (e.g., via a malicious action or a script injection attack), the overly-permissive GITHUB_TOKEN can be used to push code, approve pull requests, modify releases, or read/exfiltrate secrets. This is documented in GitHub's supply-chain security guidance.

Recommended Fix

Add a top-level permissions: read-all default (or contents: read) to every workflow, then grant only the minimum required permissions at the job level.

Minimal read-only baseline (add to all CI workflows — lint, pretty, typescript, unittests):

permissions:
  contents: read

publish.yml (pushes to Docker Hub — GITHUB_TOKEN not used for writes):

permissions:
  contents: read

release-notes.yml (creates a GitHub release):

permissions:
  contents: write

dispatch.yml (repository dispatch only — REPO_DISPATCH_TOKEN is a PAT, GITHUB_TOKEN unused):

permissions:
  contents: read

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    securitySecurity vulnerability or hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions