Repository navigation
[static-analysis] RGS-018: Suspicious Payload Execution Pattern in smoke-issues.lock.yml - #77673
Conversation
|
@copilot recompile |
|
✅ 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.
|
|
✅ 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.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: 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.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: 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 Code Quality Reviewer completed the code quality review.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found one blocking issue: the new raw JSON literal is embedded inside a GitHub Actions run block, so expression-like footer text can be evaluated by Actions before the heredoc writes the script. Please keep this data expression-inert and add regression coverage. The generated lock-file concern is outside the changed files and was not included as an inline finding.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again
| // json.Marshal escapes <, >, &, U+2028 and U+2029, so the literal is | ||
| // safe to embed. Avoid base64 decode chains, which static scanners | ||
| // (runner-guard RGS-018) flag as obfuscated payload execution. | ||
| data.SafeOutputs.Scripts[name].Script = "const connectorContentDefaults = " + string(encodedConfig) + ";\n" + |
There was a problem hiding this comment.
This removes the base64 protection while still embedding body_footer/footer directly into the run: | heredoc generated by buildCustomScriptFilesStep. GitHub Actions evaluates ${{ ... }} expressions in run blocks before the shell runs, and json.Marshal does not escape that sequence. A configured footer such as ${{ secrets.X }} can therefore be expanded and written into the generated handler source (and potentially leak the secret). Please preserve an expression-inert transport (for example, pass the JSON through an environment variable or otherwise encode/escape ${{ before placing it in the run block), and add a regression test for expression-like footer text.
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Comment MemoryPeek at saved memory (review-history)History |
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
🟡 Changes recommended
Unescaped Actions expressions in body-footer can cause compilation failures or interpolate unsafe values into generated JavaScript, potentially breaking the handler or injecting code.
1 open issue
What changed in this PR
Updates gh-aw’s connector safe-output script generation to avoid runner-guard’s base64 decode-and-execute heuristic.
Changes:
- Emits connector content defaults directly as a JSON object literal instead of decoding base64.
- Updates the compiler test to expect the literal and reject
Buffer.from(.
Generated workflow locks are excluded from this PR and still need regeneration before merge.
| File | Description |
|---|---|
pkg/workflow/connector_content_host_test.go |
Updates assertions for the generated defaults literal. |
pkg/workflow/compiler_connectors.go |
Replaces base64 decoding with direct JSON emission. |
Review effort: Max (dynamic)
| // Emit the trusted defaults as a JSON object literal (a JS expression). | ||
| // json.Marshal escapes <, >, &, U+2028 and U+2029, so the literal is | ||
| // safe to embed. Avoid base64 decode chains, which static scanners | ||
| // (runner-guard RGS-018) flag as obfuscated payload execution. | ||
| data.SafeOutputs.Scripts[name].Script = "const connectorContentDefaults = " + string(encodedConfig) + ";\n" + |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd. Requesting changes: the base64 removal is right, but the new raw JS literal lets GitHub Actions expand ${{ ... }} in body-footer.
📋 Key Themes and Highlights
Key Themes
- Expression regression (blocking):
json.Marshalescapes<,>,&, U+2028 and U+2029, but not$. Abody-footercontaining${{ github.repository }}is written verbatim into theConfigure Safe Output Scriptsrun:block, where Actions evaluates it. The base64 wrapper previously hid it. A scratch compile confirmed the raw${{in the emitted script. - Missing regression test: the updated test checks only that
Buffer.from(is absent. It does not cover expression-like footer text. - Lock file not regenerated: the PR body says
.lock.ymlchanges were stripped.smoke-issues.lock.ymlstill containsBuffer.from, so the runner-guard finding will persist until the lock is recompiled and committed.
Positive Highlights
- ✅ Correct root-cause fix: the decode-and-execute chain is gone, not just reworded.
- ✅ Escaping of
<,>,&and U+2028/U+2029 is handled byjson.Marshal, which prevents</script>-style breakage. - ✅ Small, surgical diff with the test updated in the same change.
🔧 Suggested fix
Escape $ in the JSON before embedding it, as \u0024. The JS value is unchanged, and no ${{ reaches the YAML. Add a test that asserts ${{ is absent from the compiled script.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| // json.Marshal escapes <, >, &, U+2028 and U+2029, so the literal is | ||
| // safe to embed. Avoid base64 decode chains, which static scanners | ||
| // (runner-guard RGS-018) flag as obfuscated payload execution. | ||
| data.SafeOutputs.Scripts[name].Script = "const connectorContentDefaults = " + string(encodedConfig) + ";\n" + |
There was a problem hiding this comment.
[/diagnosing-bugs] The root cause is fixed, but this introduces a regression. json.Marshal does not escape $, so a connector body-footer containing ${{ ... }} is now written verbatim into the run: block, where GitHub Actions expands it. The base64 wrapper previously kept it opaque. I confirmed the raw ${{ with a scratch compile.
💡 Suggested fix
footerLiteral := strings.ReplaceAll(string(encodedConfig), "$", `\u0024`)$ only appears inside JSON strings, so replacing it keeps the JSON valid. In JS, \u0024 decodes to $: "Policy \u0024{{ github.repository }}" evaluates to Policy ${{ github.repository }}. I checked this with Node. The fix is not applied to the branch.
@copilot please address this.
| encoded := base64.StdEncoding.EncodeToString([]byte(`{"body_footer":"Trusted policy for {workflow_name}","footer":false}`)) | ||
| require.Contains(t, script, fmt.Sprintf("const connectorContentDefaults = JSON.parse(Buffer.from(%q, 'base64').toString('utf8'));", encoded)) | ||
| require.Contains(t, script, `const connectorContentDefaults = {"body_footer":"Trusted policy for {workflow_name}","footer":false};`) | ||
| require.NotContains(t, script, "Buffer.from(") |
There was a problem hiding this comment.
[/tdd] No regression test covers the escaping gap above. This test only checks that base64 is gone. Add a case whose body-footer contains ${{ github.repository }} and assert the compiled script no longer contains the raw expression.
💡 Suggested assertion
require.NotContains(t, script, "${{")This fails on the current branch, so it would catch the regression.
@copilot please address this.
Recompiled |
|
🍳 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": "c5aa809e018ffb604a329cc7c604ec2d839c5f2c",
"kind": "requested",
"schema_version": "1",
"state": "999b2b96f666871f78f987e2db2b99dc60feb81f0ce87a5756c074ba9d2c8309",
"work": [
"42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac"
],
"workflow": "pr-sous-chef"
}
|
Recompiled |
|
🍳 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": "24863c7d101cc73ac3ad81cbaf35f86ce90d4d20",
"kind": "requested",
"schema_version": "1",
"state": "b5599a6174ecc6f791306cb83f0d5b4bd0961d4ead9c4e48a841cd6e6d2afa80",
"work": [],
"workflow": "pr-sous-chef"
}
|
…18-connector-defaults-literal-be9b45ad4c4c20ac # Conflicts: # pkg/workflow/connector_content_host_test.go Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged the latest |
|
🍳 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": "cbc3058816397707959ea77474ef6d45f1d4097e",
"kind": "requested",
"schema_version": "1",
"state": "82cfaba220c95adcfbbba752d7e82c341206419c2c74020cb4a8870881d6673e",
"work": [],
"workflow": "pr-sous-chef"
}
|
|
@copilot resolve the merge conflicts on this branch. |
…18-connector-defaults-literal-be9b45ad4c4c20ac # Conflicts: # docs/public/cracktro/deck.js Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged the latest |
|
@copilot resolve the merge conflicts on this branch. |
…18-connector-defaults-literal-be9b45ad4c4c20ac Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged the latest |
|
🍳 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": "e915d87ef51fada3bd8fbc08091e3239b08aa7cd",
"kind": "requested",
"schema_version": "1",
"state": "11dd244a3bdd5871236e4cd48dc339be8f77e803b0d8736b1dfc05fe447f67a7",
"work": [],
"workflow": "pr-sous-chef"
}
|
…18-connector-defaults-literal-be9b45ad4c4c20ac # Conflicts: # docs/public/cracktro/deck.js Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Recompiled all 367 workflows successfully.
Merged the latest |
|
🎉 This pull request is included in a new release. Release: |

Warning
Changes to workflow YAML files were excluded from this changeset to avoid GitHub token workflow-write restrictions. Run
gh aw compileagain on this branch and commit the regenerated.lock.ymlfiles using credentials permitted to update GitHub Actions workflows before merging.🚨 Runner-Guard Security Finding
Rule: RGS-018 — Suspicious Payload Execution Pattern
Severity: High
File:
.github/workflows/smoke-issues.lock.ymlLine: 2818 (Configure Safe Output Scripts step)
Description
Runner-guard flags the generated Jira/Linear connector safe-output scripts because they contain
JSON.parse(Buffer.from("e30=", base64).toString(utf8))next to aspawnSynccall, which matches its decode-and-execute heuristic.Assessment
False positive. The base64 value is compiler-generated trusted connector content defaults (
{}here,footer/body_footerotherwise), not a payload, and nothing decoded is executed. The base64 round-trip was unnecessary and trips the scanner.Remediation (implemented)
pkg/workflow/compiler_connectors.gonow emits the defaults as a JSON object literal,const connectorContentDefaults = {...};.json.Marshalescapes<,>,&, U+2028 and U+2029, so the literal is safe to embed as JS. The base64 decode chain is removed from generated scripts. The unit test was updated to assert the literal and the absence ofBuffer.from(.Validation
go build ./pkg/workflow/,go vet ./pkg/workflow/and gofmt: cleango test ./pkg/workflow/ -run TestConnector -count=1: PASS (includes the node-based generated-factory tests)gh aw compile smoke-issues: succeeds; regenerated lock has nobase64occurrencesmake agent-report-progress: the impacted-test and custom-linter steps ran, but the Go lint step failed becausegolangci-lintis not installed in this sandbox. It was not run.Note:
.lock.ymlchanges are stripped from delivery; a maintainer must rungh aw compileand commit the regenerated locks (smoke-issues.lock.yml).Detected by runner-guard v2.6.0 — CI/CD source-to-sink vulnerability scanner
Workflow run: https://github.com/github/gh-aw/actions/runs/43557736817
🤖 Generated with [Claude Code]((claude.com/redacted)