Repository navigation
Test activation metadata quoting against shell breakouts - #79597
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully!
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
What this change does: It adds regression coverage for quoted activation metadata in environment values and chunked output.
Should fix: The chunked-output test duplicates the existing test runner; a shared helper can keep the two cases in sync.
Verdict: fix the duplication.
Not checked: I did not run the shell-breakout regression.
Lean: -10 lines possible.
Generated by ✂️ Ponytail Reviewer for #79597 · codex · routed: gpt61 medium · ~6 AIC · ⌖ ~1 AIC · ⊞ 185
Comment /ponytail to run again
|
|
||
| runnerTemp := t.TempDir() | ||
| chunks := 0 | ||
| for _, step := range document.Jobs["activation"].Steps { |
There was a problem hiding this comment.
The large-metadata test already runs these same chunks and reads the resulting file, so a change to the chunk format now requires two test runners to be updated; extract that shared setup into one test helper and keep the quote-specific assertions here.
There was a problem hiding this comment.
Extracted chunk execution and payload reading into a shared helper used by both tests. Updated in 2516c950.
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
No actionable issues found in the changed test coverage. The added cases exercise both environment and chunked-shell metadata paths and verify payload round-tripping and shell-breakout inertness. Static review only; tests were not run.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd — requesting changes because the new regression test fails as written.
Both subtests of TestCompilerActivationMarkdownMetadataQuoting fail at compile time. The payload contains ${{ github.event }}, which the expression allowlist rejects, so the test never reaches the metadata quoting path it is meant to cover.
📋 Key Themes & Highlights
Key Themes
- Failing test: the payload uses a non-allowlisted expression. Replacing it with
${{ github.event.issue.title }}makes both subtests pass locally, which suggests the quoting logic is sound. - Verified scope: the diff touches only the test file, with no production changes.
Positive Highlights
- ✅ Good coverage choice: exercises both the environment path and the chunked
printfpath. - ✅ The chunked test checks that the injected marker file is not created.
- ✅
gofmtreports no formatting issues.
@copilot please address the review comment above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| } | ||
|
|
||
| func TestCompilerActivationMarkdownMetadataQuoting(t *testing.T) { | ||
| const attack = `'; touch "$RUNNER_TEMP/metadata-escaped"; # ${{ github.event }}` |
There was a problem hiding this comment.
[/tdd] The attack payload contains ${{ github.event }}, which the compile-time expression allowlist rejects. Both subtests fail in compileActivationMetadataWorkflow with Validation failed for field 'expressions' ... 1 unauthorized expressions found, so the metadata quoting code is never exercised.
💡 Suggested fix
Use an allowlisted expression such as ${{ github.event.issue.title }}. I checked this locally: with that substitution, TestCompilerActivationMarkdownMetadataQuoting/environment and /chunked_printf both pass, so the quoting logic itself holds.
If github.event must stay in the payload, the test should assert on the expected validation error instead of compiling successfully.
@copilot please address this.
There was a problem hiding this comment.
Changed the fixture to workflow_call and the payload expression to ${{ inputs.model }}; the regression tests pass. Updated in 2516c950.
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
🟡 Changes recommended
A disallowed fixture expression makes both metadata subtests fail before quoting checks, while the chunked subtest lacks an assertion against live GitHub Actions expressions.
2 open issues
What changed in this PR
This test-only PR adds regression coverage for activation metadata quoting in the gh-aw compiler, supporting the security-alert investigation in #79542.
Changes:
- Adds an adversarial payload to check YAML environment-value escaping and JSON round-tripping.
- Exercises generated chunked
printfcommands in Bash, checking payload preservation and absence of an injected marker file.
| File | Description |
|---|---|
pkg/workflow/compiler_markdown_metadata_test.go |
Adds quoting regressions for environment scalars and chunked shell output. |
Review effort: Max (adaptive)
| const attack = `'; touch "$RUNNER_TEMP/metadata-escaped"; # ${{ github.event }}` | ||
| workflow := func(model string) string { | ||
| return fmt.Sprintf("---\non: workflow_dispatch\nstrict: false\nengine: copilot\n---\n# Work\n\n## agent: reader\n---\nmodel: %q\ntools: [Read]\n---\nRead files.\n## end agent: reader\n", model) |
There was a problem hiding this comment.
Changed the fixture to workflow_call with ${{ inputs.model }}. Updated in 2516c950.
| if !strings.HasPrefix(step.Run, "printf '%s' '") { | ||
| break | ||
| } | ||
| command := exec.Command("bash", "-e", "-c", step.Run) |
There was a problem hiding this comment.
The shared chunk runner now asserts each generated step.Run contains no ${{ before executing it. Updated in 2516c950.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "b2b570ce34c37eec6baca0626d2c93a77ba820b0",
"kind": "requested",
"schema_version": "1",
"state": "eb646deee85cb1c7fae8669fd54873bf24c6db8307a783b58ddefcfc87f6fd49",
"work": [
"0384d253d3410c71a864e41868d2b53514a0546251850d41a7465f9d24f0c2f9",
"070b5fed6c77e6f99af8aa0864293d562a676d9316dad5428bdc04c242733226",
"5abca6a1cf798ab7cad7c5526b0c8f36fe66cca179cd1e8a0e551988700e5e12",
"5c976ed5a8dfb0029ad82b40ab3223f84638189dfcdb12264abc0a585a15506f",
"9389f29e4128b51c2b94d5955c74200424bda5cc40389ba434363a9ab39500c1",
"aca3b7bb36949497f61b0af4562879b10bc58cf763a2203a43a2b65d905aff42"
],
"workflow": "pr-sous-chef"
}
|
…nce-uk-ai-governance-triage-alerts-11 Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged latest |


Critical alerts flagged activation metadata embedded in single-quoted YAML and shell strings. Add regression coverage to verify quote-breaking payloads remain inert in both output paths.
printf: Execute generated commands and verify the payload is preserved without creating the injected marker file.The regression uses a payload shaped like: