-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Description
Fix security issue where 14 workflows triggered by risky events (issue_comment, pull_request_target) use default (overly broad) permissions. This violates the principle of least privilege and increases attack surface.
Security Impact
When workflows are triggered by risky events, they run with the repository's full context and secrets. Default permissions grant excessive access (contents: write, issues: write, etc.), which could be exploited if the workflow has vulnerabilities.
Affected Workflows
The following 14 workflows need explicit minimal permissions:
- ai-moderator.md
- archie.md
- brave.md
- cloclo.md
- grumpy-reviewer.md
- mergefest.md
- pdf-summary.md
- plan.md
- pr-nitpick-reviewer.md
- q.md
- scout.md
- security-review.md
- tidy.md
- unbloat-docs.md
Suggested Changes
Add explicit minimal permissions to YAML frontmatter in each workflow:
For Issue/PR Comment Bots:
permissions:
contents: read
issues: write
pull-requests: writeFor PR Review Bots:
permissions:
contents: read
pull-requests: writeFor Read-Only Analysis:
permissions:
contents: readSuccess Criteria
- All 14 workflows have explicit permissions block
- Permissions follow principle of least privilege
- Each workflow tested and functions correctly
- No permission errors in workflow logs
- Workflows recompiled (make recompile)
- Static analysis scan passes (no zizmor warnings)
Implementation Steps
- Review each workflow to determine required permissions
- Add permissions block to YAML frontmatter
- Use most restrictive level (read vs write)
- Test workflow execution
- Verify no permission errors
- Recompile workflows
Benefits
- Reduces attack surface significantly
- Follows security best practices
- Limits damage from potential vulnerabilities
- Eliminates zizmor security warnings
Priority
High - Security improvement with straightforward fix
Source
Extracted from Static Analysis Report #12558 - Zizmor Security Findings
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 12, 2026, 5:15 PM UTC