Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Shell scripts in actions/setup/sh/ were echoing environment variables without proper escaping, creating potential injection vectors and formatting issues.

Changes

Applied ${var@Q} operator to environment variables in 9 shell scripts:

Security-sensitive outputs:

  • API keys written to GITHUB_OUTPUT in start_safe_inputs_server.sh, start_safe_outputs_server.sh, start_mcp_gateway.sh

User-controlled data:

  • Branch names in generate_git_patch.sh (20 instances)
  • URLs in validate_multi_secret.sh, check_mcp_servers.sh, validate_gatewayed_server.sh, install_awf_binary.sh
  • File paths in clean_git_credentials.sh, check_mcp_servers.sh, validate_gatewayed_server.sh

Example

# Before
echo "api_key=$GH_AW_SAFE_INPUTS_API_KEY" >> "$GITHUB_OUTPUT"
echo "Branch $BRANCH_NAME exists, generating patch"

# After
echo "api_key=${GH_AW_SAFE_INPUTS_API_KEY@Q}" >> "$GITHUB_OUTPUT"
echo "Branch ${BRANCH_NAME@Q} exists, generating patch"

The @Q operator quotes values to prevent shell metacharacter interpretation - critical for branch names like feat/foo$bar or API keys containing special characters.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Changeset

  • Type: patch
  • Description: Quote environment variables with ${VAR@Q} in the setup shell scripts so echoed values cannot inject special characters or break output parsing.

Generated by Changeset Generator

Copilot AI and others added 3 commits February 11, 2026 22:15
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Added ${var@Q} escaping to API keys in GITHUB_OUTPUT writes
- Applied escaping to user-controlled branch names in generate_git_patch.sh
- Protected URLs and paths in diagnostic output
- Secured error messages with file paths and configuration URLs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Review shell scripts that echo environment variables Apply shell escaping with @Q to environment variables in echo statements Feb 11, 2026
Copilot AI requested a review from pelikhan February 11, 2026 22:27
@pelikhan pelikhan marked this pull request as ready for review February 11, 2026 22:36
Copilot AI review requested due to automatic review settings February 11, 2026 22:36
@pelikhan pelikhan added the smoke label Feb 11, 2026
@github-actions
Copy link
Contributor

🧪 Smoke Project is now testing project operations...

@github-actions
Copy link
Contributor

📰 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 11, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Changeset Generator completed successfully!

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 applies shell escaping with the ${var@Q} operator to environment variables in echo statements across 9 shell scripts in actions/setup/sh/, preventing shell metacharacter interpretation for security-sensitive outputs (API keys), user-controlled data (branch names, URLs), file paths, and error messages. However, the PR also includes several unrelated changes to documentation and workflow configurations.

Changes:

  • Applied ${var@Q} escaping to environment variables in 9 shell scripts (validate_multi_secret.sh, validate_gatewayed_server.sh, start_safe_outputs_server.sh, start_safe_inputs_server.sh, start_mcp_gateway.sh, install_awf_binary.sh, generate_git_patch.sh, clean_git_credentials.sh, check_mcp_servers.sh)
  • Updated rate limiting documentation in frontmatter-full.md (unrelated to shell escaping)
  • Added Bot Detection Agent and removed Test Rate Limiting workflow from agent-factory-status.mdx (unrelated to shell escaping)
  • Reordered rate limit event types in two workflow files (unrelated to shell escaping)

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
actions/setup/sh/validate_multi_secret.sh Applied @q escaping to DOCS_URL in error messages
actions/setup/sh/validate_gatewayed_server.sh Applied @q escaping to MCP_CONFIG_PATH, GATEWAY_URL, and server_url in error messages
actions/setup/sh/start_safe_outputs_server.sh Applied @q escaping to GH_AW_SAFE_OUTPUTS_API_KEY in GITHUB_OUTPUT
actions/setup/sh/start_safe_inputs_server.sh Applied @q escaping to GH_AW_SAFE_INPUTS_API_KEY in GITHUB_OUTPUT
actions/setup/sh/start_mcp_gateway.sh Applied @q escaping to MCP_GATEWAY_API_KEY in GITHUB_OUTPUT
actions/setup/sh/install_awf_binary.sh Applied @q escaping to BINARY_URL and CHECKSUMS_URL in informational messages
actions/setup/sh/generate_git_patch.sh Applied @q escaping to 20 instances of branch names, SHAs, file paths, and other variables
actions/setup/sh/clean_git_credentials.sh Applied @q escaping to GIT_CONFIG_PATH in informational messages
actions/setup/sh/check_mcp_servers.sh Applied @q escaping to GATEWAY_CONFIG_PATH, SERVER_URL, and LAST_ERROR in error messages
docs/src/content/docs/reference/frontmatter-full.md Updated rate-limit.max documentation from "Defaults to 5" to "Required field" and added maximum window limit (unrelated change)
docs/src/content/docs/agent-factory-status.mdx Added Bot Detection Agent entry and removed Test Rate Limiting workflow entry (unrelated changes)
.github/workflows/auto-triage-issues.lock.yml Reordered GH_AW_RATE_LIMIT_EVENTS from "issues,workflow_dispatch" to "workflow_dispatch,issues" (unrelated change)
.github/workflows/ai-moderator.lock.yml Reordered GH_AW_RATE_LIMIT_EVENTS from "workflow_dispatch,issues,issue_comment" to "issues,issue_comment,workflow_dispatch" (unrelated change)

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

GH_AW_RATE_LIMIT_MAX: "5"
GH_AW_RATE_LIMIT_WINDOW: "60"
GH_AW_RATE_LIMIT_EVENTS: "issues,workflow_dispatch"
GH_AW_RATE_LIMIT_EVENTS: "workflow_dispatch,issues"
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The reordering of rate limit events from "issues,workflow_dispatch" to "workflow_dispatch,issues" appears unrelated to the PR's stated purpose of applying shell escaping with @q operator to environment variables. This change should either be in a separate PR or explained in the PR description.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.52.0
jq 1.7
yq 4.52.2
curl 8.5.0
gh 2.86.0
node 20.20.0
python3 3.12.3
go go1.24.12
java 21.0.7
dotnet 10.0.102

Result: 12/12 tools available ✅

All required development tools are present and functional in the agent container environment.

AI generated by Agent Container Smoke Test

@github-actions
Copy link
Contributor

Smoke Project completed successfully. All project operations validated.

@github-actions
Copy link
Contributor

Smoke test results:
PR titles: Add bot detection workflow; Add temporary ID resolution for create-project item_url and update-project content_number
✅ GitHub MCP (2 merged PRs)
✅ Serena MCP (activate + find_symbol)
✅ Playwright (title contains GitHub)
✅ File write + bash cat
✅ Build (make build)
Overall: PASS

AI generated by Smoke Codex

@github-actions
Copy link
Contributor

🤖 Beep boop! The smoke test agent zoomed through here at lightning speed! ⚡

Just validated that all systems are nominal and ready to catch those pesky security issues. Keep up the excellent work on maintaining our fortress of quality! 🛡️✨

Smoke test run §21925816900 — all systems green!

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

Smoke Test Results

Status: ✅ PASS

Test Result
GitHub MCP
Safe Inputs GH CLI
Serena MCP
Playwright
File Writing
Bash Tool
Discussion Interaction
Build gh-aw
Workflow Dispatch

PRs Tested: #15018, #15017
Run: §21925816900

AI generated by Smoke Copilot

@pelikhan pelikhan merged commit d87db08 into main Feb 11, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/review-shell-scripts-echo-env-vars branch February 11, 2026 22:43
@github-actions
Copy link
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants