🔒 Zizmor Security Analysis Report - 2025-10-31 #2855
Closed
Replies: 2 comments 1 reply
-
|
/plan focus on Template Injection Fix Guide |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
This discussion was automatically closed because it was created by an agentic workflow more than 1 week ago. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🔒 Zizmor Security Analysis Report - 2025-10-31
Executive Summary
I completed a comprehensive security scan of all agentic workflows using zizmor v1.16.1, a specialized security scanner for GitHub Actions. The scan identified 198 security findings across 62 compiled workflows, with the vast majority (88.9%) being template injection vulnerabilities.
Key Findings:
Security Scan Statistics
Overall Findings
Findings by Vulnerability Type
Top Priority: Template Injection (176 findings)
What is Template Injection?
Template injection occurs when GitHub Actions expressions (
${{ ... }}) are used inrun:blocks where they could expand into attacker-controllable code. This allows malicious actors to inject commands that execute in your CI/CD environment.Impact
Common Vulnerable Patterns Found
Pattern 1: Environment Variables in Run Blocks (74 occurrences)
Pattern 2: GitHub Actor in String Contexts
Pattern 3: GitHub Event Fields
The Fix: Use Environment Variables
Before (Vulnerable):
After (Secure):
Most Affected Workflows
Other Security Issues
2. Excessive Permissions (13 findings)
Issue: Workflows using
permissions: read-allor overly broadid-token: writeat workflow level.Affected Workflows:
Fix: Use least-privilege permissions by specifying only required permissions:
3. GitHub Environment File Usage (3 findings)
Issue: Writing to
$GITHUB_ENVwithout sanitization can allow code execution.Location:
.github/workflows/ci-doctor.lock.yml:1777Fix: Sanitize values before writing to
$GITHUB_ENV:4. Dangerous Triggers (3 findings)
Issue: Using
workflow_runtrigger which is almost always insecure.Affected:
Fix: If possible, use alternative triggers or implement strict input validation.
5. Credential Persistence (3 findings - artipacked)
Issue:
actions/checkoutwithoutpersist-credentials: falseleaves credentials in .git/config.Affected:
Fix:
Detailed Fix Guide
Comprehensive Fix Instructions for Template Injection
Template Injection Fix Guide
Case 1: MCP Server Configuration (Most Common)
This affects nearly every workflow when creating MCP server configuration.
Current Code (Vulnerable):
Fixed Code (Secure):
Case 2: GitHub Context in Comments/Issues
Current Code (Vulnerable):
Fixed Code (Secure):
Case 3: Default Branch Usage
Current Code (Vulnerable):
Fixed Code (Secure):
Case 4: User/Workflow Inputs
Current Code (Vulnerable):
Fixed Code (Secure):
Automation Approach
For bulk fixes across workflows, consider this approach:
run:blocks containing${{ ... }}env:entriesRecommendations
Immediate Actions (Week 1)
✅ Fix Critical Template Injections (90 ERROR-level findings)
✅ Review Dangerous Triggers
✅ Fix GitHub Environment File Issues
Short-term Actions (Week 2-3)
✅ Address HELP-level Template Injections (74 findings)
✅ Reduce Excessive Permissions (13 findings)
read-allwith specific permissionsid-token: writeto job level where needed✅ Fix Credential Persistence (3 findings)
persist-credentials: falseto checkout actionsLong-term Actions (Month 1)
✅ Automate Security Scanning
✅ Update Development Guidelines
✅ Establish Monitoring
Historical Context
This is the first comprehensive security scan using zizmor for this repository. Key insights:
Future scans will track:
Verification Steps
After applying fixes, verify with:
Expected outcome: Significant reduction in findings, with template-injection issues resolved.
Resources
/tmp/gh-aw/cache-memory/fix-templates/template-injection.md/tmp/gh-aw/cache-memory/security-scans/2025-10-31.json/tmp/gh-aw/agent/zizmor-output.txtNext Steps
Security is an ongoing process. This scan provides a baseline and clear path forward to significantly improve the security posture of all agentic workflows.
Scan Completed: 2025-10-31
Scanner: zizmor v1.16.1
Repository: githubnext/gh-aw
Agent: Claude (Zizmor Security Analyzer)
Beta Was this translation helpful? Give feedback.
All reactions