Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

  • Understand the issue: PATH export command in GetHostedToolcachePathSetup() needs sanitization
  • Create bash script actions/setup/sh/sanitize_path.sh with PATH sanitization logic
  • Create bash test script actions/setup/sh/sanitize_path_test.sh for the sanitization script
  • Refactor GetSanitizedPATHExport() to source the bash script from /opt/gh-aw/actions/sanitize_path.sh
  • Update Go tests to match new implementation
  • Run make fmt to format code
  • Run make recompile to regenerate 141 workflow lock files
  • Run make lint for validation
  • Merge main and recompile workflows

Security Summary

  • No security vulnerabilities found by CodeQL
  • The change hardens PATH handling to prevent potential attacks from malformed PATH entries (empty elements, leading/trailing colons)
Original prompt

The agent runing inside awf firewall has this command:

export PATH="$GH_AW_TOOL_BINS$(find /opt/hostedtoolcache -maxdepth 4 -type d -name bin 2>/dev/null | tr '\n' ':')$PATH"

it can be attacked.

Harden this by applying some sanitization methods like remove empty elements and trailing/leading colons etc.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Changeset

  • Type: patch
  • Description: Sanitize the AWF firewall PATH export by sourcing the new helper so empty elements and stray colons are removed before exporting.

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

Copilot AI and others added 3 commits January 28, 2026 22:39
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
…ding/trailing colons

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Harden PATH variable setup in agent command Harden PATH export with sanitization to prevent empty element attacks Jan 28, 2026
Copilot AI requested a review from Mossaka January 28, 2026 23:12
@Mossaka
Copy link
Collaborator

Mossaka commented Jan 28, 2026

@copilot refactor it to a bash script and reference it

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 28, 2026

@copilot refactor it to a bash script and reference it

Refactored the PATH sanitization logic to a bash script in actions/setup/sh/sanitize_path.sh with corresponding tests in sanitize_path_test.sh. The Go code now sources the script via source /opt/gh-aw/actions/sanitize_path.sh. Commit: 85c4bb3

@Mossaka Mossaka marked this pull request as ready for review January 28, 2026 23:41
@Mossaka Mossaka added the smoke label Jan 28, 2026
@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 Jan 28, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

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

@github-actions
Copy link
Contributor

Smoke Test Results

PRs Retrieved:

Test Status:

  • ✅ GitHub MCP
  • ✅ Safe Inputs GH CLI
  • ✅ Serena MCP
  • ✅ Playwright
  • ✅ File Writing
  • ✅ Bash Tool
  • ✅ Discussion Interaction
  • ✅ Build gh-aw

Overall: ✅ PASS

cc @Mossaka

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

Smoke Test: Claude - PASS ✅

PRs Reviewed:

Test Results: ✅ GitHub MCP | ✅ GH CLI | ✅ Serena | ✅ Make | ✅ Playwright | ✅ Tavily | ✅ File Ops | ✅ Bash | ✅ Discussion

Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

GitHub MCP merged PRs ✅: docs: Document agent container build/test environment from epic #11970; Add canary_go job to agent-ci.yml to detect untested Go functions
safeinputs gh PRs ✅: [WIP] Add security documentation for container mounting risks; Create smoke test workflow to validate common development tool availability
Serena activate ✅; Playwright title ✅; Tavily search ✅
File write ✅; Bash cat ✅
Discussion comment ✅; Build ✅
Overall: PASS

AI generated by Smoke Codex

@pelikhan
Copy link
Contributor

@copilot merge main, recompile

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot merge main, recompile

Merged main and recompiled all 141 workflows. Commit: 57432ea

Copilot AI requested a review from pelikhan January 29, 2026 00:25
@Mossaka Mossaka merged commit d3e279a into main Jan 29, 2026
49 checks passed
@Mossaka Mossaka deleted the copilot/harden-path-setup branch January 29, 2026 01:38
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.

3 participants