Skip to content

Fix compiler obfuscation: Don't wrap static quoted values in ${{ }}#14257

Merged
pelikhan merged 2 commits intomainfrom
copilot/address-zizmor-security-findings
Feb 7, 2026
Merged

Fix compiler obfuscation: Don't wrap static quoted values in ${{ }}#14257
pelikhan merged 2 commits intomainfrom
copilot/address-zizmor-security-findings

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

The workflow compiler was wrapping static quoted strings in ${{ }} expressions, triggering 122 zizmor obfuscation warnings across all compiled workflows.

Problem

generatePlaceholderSubstitutionStep() in compiler_yaml_helpers.go wrapped all ExpressionMapping.Content values in ${{ }}, including static strings:

# Generated (incorrect):
env:
  GH_AW_CACHE_DESCRIPTION: ${{ '' }}
  GH_AW_CACHE_DIR: ${{ '/tmp/gh-aw/cache-memory/' }}

# Should be:
env:
  GH_AW_CACHE_DESCRIPTION: ''
  GH_AW_CACHE_DIR: '/tmp/gh-aw/cache-memory/'

Changes

  • compiler_yaml_helpers.go: Detect quoted strings (start/end with ' or ") and output directly. Only wrap GitHub expressions like github.repository in ${{ }}
  • Test coverage: Added TestGeneratePlaceholderSubstitutionStep with static/expression/mixed cases
  • Test updates: Updated 4 integration tests expecting old format
  • Workflow regeneration: Recompiled all 147 .lock.yml files

Impact

Eliminates 122 false positive security warnings (67% reduction from 182 to 60 total findings).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/woodruffw/zizmor/releases/latest
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Code Quality] Address zizmor security findings across all workflows</issue_title>
<issue_description>## Description

Static analysis using zizmor (security scanner) identified security vulnerabilities in agentic workflows. With 346 total findings across 147 workflows, addressing security issues systematically will improve overall workflow security posture.

Suggested Changes

Phase 1: Triage zizmor security findings (0.5 days)

  1. Run zizmor on all workflows and collect security findings
  2. Categorize by severity: Critical, High, Medium, Low
  3. Group by vulnerability type:
    • Injection vulnerabilities
    • Insecure practices
    • Missing security controls
    • Dangerous permissions
  4. Prioritize Critical and High severity issues

Phase 2: Fix high-severity issues (1.5 days)

For each high-severity vulnerability type:

  • Create fix pattern or codemod
  • Apply to affected workflows
  • Add validation rules to prevent recurrence
  • Document security best practices

Phase 3: Address medium/low severity (1 day)

  • Fix remaining issues systematically
  • Update security documentation
  • Add pre-commit checks where applicable

Expected Vulnerability Types

Common zizmor findings:

  • Expression injection in workflow triggers
  • Untrusted input used in dangerous contexts
  • Overly permissive GitHub token permissions
  • Secrets exposure risks
  • Insecure artifact handling

Files Affected

  • All 147 workflow files in .github/workflows/*.md
  • Security validation in pkg/workflow/*_validation.go
  • Possible new security checks in validation layer
  • Documentation updates in docs/ and scratchpad/

Success Criteria

  • All zizmor findings categorized by severity and type
  • Critical and High severity issues fixed (0 remaining)
  • Medium severity reduced by 80%+
  • Security validation rules added to prevent recurrence
  • Security best practices documented
  • No CI regressions introduced
  • All tests passing after fixes

Source

Extracted from Static Analysis Report discussion github/gh-aw#14235

Context from report:

Priority

High - Security vulnerabilities affect all workflows and should be addressed systematically to reduce attack surface.

AI generated by Discussion Task Miner - Code Quality Improvement Agent

  • expires on Feb 8, 2026, 1:29 AM UTC

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Address zizmor security findings in workflows Fix compiler obfuscation: Don't wrap static quoted values in ${{ }} Feb 7, 2026
Copilot AI requested a review from pelikhan February 7, 2026 03:18
@pelikhan pelikhan marked this pull request as ready for review February 7, 2026 03:39
Copilot AI review requested due to automatic review settings February 7, 2026 03:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the workflow compiler’s placeholder-substitution env generation so that static quoted string literals are emitted as plain YAML strings (instead of being wrapped in ${{ }}), reducing zizmor “obfuscation” findings across generated workflow lockfiles.

Changes:

  • Adjust generatePlaceholderSubstitutionStep() to emit quoted static values directly and only wrap non-quoted content in ${{ }}.
  • Add a focused unit test for placeholder substitution behavior and update multiple integration tests to match the new output.
  • Regenerate compiled workflow .lock.yml files to reflect the new env formatting.

Reviewed changes

Copilot reviewed 66 out of 66 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/workflow/compiler_yaml_helpers.go Changes placeholder substitution env rendering to avoid ${{ }} wrapping for quoted static values.
pkg/workflow/compiler_yaml_helpers_test.go Adds unit tests covering static/expression/mixed placeholder substitution cases.
pkg/workflow/cache_memory_integration_test.go Updates integration expectations for cache-memory env var formatting.
pkg/workflow/prompts_test.go Updates generated workflow assertion for cache dir env var formatting.
pkg/workflow/unified_prompt_creation_test.go Updates assertions for cache dir env var formatting in unified prompt creation output.
.github/workflows/weekly-issue-summary.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/unbloat-docs.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/test-create-pr-error-handling.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/technical-doc-writer.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/super-linter.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/step-name-alignment.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/static-analysis-report.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/stale-repo-identifier.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/smoke-copilot.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/smoke-codex.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/smoke-claude.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/slide-deck-maintainer.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/sergo.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/security-review.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/scout.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/schema-consistency-checker.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/safe-output-health.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/q.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/python-data-charts.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/prompt-clustering-analysis.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/pr-nitpick-reviewer.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/portfolio-analyst.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/poem-bot.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/pdf-summary.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/org-health-report.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/mcp-inspector.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/lockfile-stats.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/jsweep.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/instructions-janitor.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/grumpy-reviewer.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/go-logger.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/go-fan.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/glossary-maintainer.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/github-mcp-tools-report.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/github-mcp-structural-analysis.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/firewall-escape.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/developer-docs-consolidator.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/deep-report.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-safe-output-optimizer.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-repo-chronicle.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-performance-summary.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-news.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-mcp-concurrency-analysis.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-issues-report.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-firewall-report.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-doc-updater.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-copilot-token-report.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-compiler-quality.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/daily-code-metrics.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/copilot-session-insights.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/copilot-pr-prompt-analysis.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/copilot-agent-analysis.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/code-scanning-fixer.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/cloclo.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/cli-version-checker.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/claude-code-user-docs-review.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/ci-doctor.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/ci-coach.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/audit-workflows.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.
.github/workflows/agent-persona-explorer.lock.yml Regenerated lockfile reflecting unwrapped quoted cache env values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +75 to +83
// Check if this is a static quoted value (starts and ends with quotes)
if (strings.HasPrefix(content, "'") && strings.HasSuffix(content, "'")) ||
(strings.HasPrefix(content, "\"") && strings.HasSuffix(content, "\"")) {
// Static value - output directly without ${{ }} wrapper
fmt.Fprintf(yaml, indent+" %s: %s\n", mapping.EnvVar, content)
} else {
// GitHub expression - wrap in ${{ }}
fmt.Fprintf(yaml, indent+" %s: ${{ %s }}\n", mapping.EnvVar, content)
}
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quoted-string detection is too broad: an expression like "'foo' || 'bar'" (or other expressions that start/end with quotes but contain operators) would be misclassified as a static value and emitted without ${{ }}, producing invalid YAML / wrong runtime behavior. Consider tightening the check to only treat the content as static when it is entirely a single quoted string literal (e.g., regex/parse that matches a full single- or double-quoted literal, including escaped quotes), otherwise keep wrapping in ${{ }}.

Copilot uses AI. Check for mistakes.
},
},
{
name: "github expressions wrapped in ${{}}}",
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test case name has an extra closing brace (${{}}}) which looks like a typo and makes the table-driven test output harder to read; consider renaming it to reflect the intended ${{ }} wrapping.

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan added the smoke label Feb 7, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

Changeset Generator failed. Please review the logs for details.

@pelikhan pelikhan merged commit 845b1a3 into main Feb 7, 2026
184 of 189 checks passed
@pelikhan pelikhan deleted the copilot/address-zizmor-security-findings branch February 7, 2026 03:45
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Code Quality] Address zizmor security findings across all workflows

2 participants