You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
M1: Add explicit least-privilege permissions to .github/workflows/ci.yml #82
.github/workflows/ci.yml:1-28 omits a top-level permissions: block (and job-level permissions: blocks), whereas .github/workflows/docs.yml:26, codeql.yml:31, release.yml:24, and sync-main-to-dev.yml:8 all declare explicit permissions:.
On repositories or forks where the default GITHUB_TOKEN permission is read-write, lint, test, and test-macos jobs inherit write permissions unnecessarily.
Proof
Parsed all workflow files in .github/workflows/ at origin/dev@db5fc07 with PyYAML:
/home/harsh/Documents/ether/.venv/bin/python3 -c "import yamlfrom pathlib import Pathfor p in sorted(Path('/tmp/ether-audit-A/.github/workflows').glob('*.yml')): d = yaml.safe_load(p.read_text()) print(p.name, 'top:', 'permissions' in d, 'jobs:', {k: ('permissions' in v) for k, v in (d.get('jobs') or {}).items()})"# ci.yml top: False jobs: {'lint': False, 'test': False, 'test-macos': False}# codeql.yml top: False jobs: {'analyze': True}# docs.yml top: True jobs: {'claims': False}# release.yml top: True jobs: {'pypi-release': True, 'docker-release': True}# sync-main-to-dev.yml top: True jobs: {'sync-dev': False}
Impact
Violates least-privilege GITHUB_TOKEN hardening on PR and push CI runs in repositories with permissive default token settings. Does not affect runtime GatePolicy.SAFE enforcement.
Acceptance criteria
Add top-level permissions:\n contents: read to .github/workflows/ci.yml
Verify all CI jobs (lint, test, test-macos) pass with contents: read
Activity