fix: chmod -R a+rX to allow directory traversal during artifact upload#2555
fix: chmod -R a+rX to allow directory traversal during artifact upload#2555
Conversation
…tory traversal during artifact upload The EACCES error on stat was caused by `chmod -R a+r` which does not add execute (search) permission to directories. Without execute permission on a directory, the runner user cannot traverse it to stat/read files inside. Using `chmod -R a+rX` instead applies: - Read permission to all files and directories - Execute permission to directories (the X flag applies execute only to directories, and to files that already have any execute bit set) This fixes EACCES errors when actions/upload-artifact tries to stat files in /tmp/gh-aw/sandbox/firewall/audit/ (created by AWF running as root via sudo). Fixes #2538 Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/c9be8403-91ce-4861-aa4c-a9492f18b1ac Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR fixes GitHub Actions artifact upload failures caused by insufficient directory traversal permissions on root-owned firewall log/audit directories created under /tmp/gh-aw/sandbox/firewall (created via sudo).
Changes:
- Update the “Print firewall logs” step across the agentic workflow lock files to use
sudo chmod -R a+rX ...instead ofa+r. - Ensure directories under
/tmp/gh-aw/sandbox/firewallbecome traversable (execute/search bit) soactions/upload-artifactcan stat and upload them.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/update-release-notes.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/test-coverage-reporter.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/test-coverage-improver.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/smoke-services.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/smoke-copilot.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/smoke-copilot-byok.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/smoke-codex.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/smoke-claude.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/smoke-chroot.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/security-review.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/security-guard.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/secret-digger-copilot.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/secret-digger-codex.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/secret-digger-claude.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/refactoring-scanner.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/plan.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/pelis-agent-factory-advisor.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/issue-monster.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/issue-duplication-detector.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/firewall-issue-dispatcher.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/export-audit.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/duplicate-code-detector.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/doc-maintainer.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/dependency-security-monitor.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/copilot-token-usage-analyzer.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/copilot-token-optimizer.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/cli-flag-consistency-checker.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/claude-token-usage-analyzer.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/claude-token-optimizer.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/ci-doctor.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/ci-cd-gaps-assessment.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
| .github/workflows/build-test.lock.yml | Use chmod -R a+rX to allow traversal of firewall dirs for artifact upload. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 32/32 changed files
- Comments generated: 1
| # Fix permissions on firewall logs/audit dirs so they can be uploaded as artifacts | ||
| # AWF runs with sudo, creating files owned by root | ||
| sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall 2>/dev/null || true | ||
| sudo chmod -R a+rX /tmp/gh-aw/sandbox/firewall 2>/dev/null || true |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot merge main and address review feedback |
…copilot-token-analyzer Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Merged origin/main (e61f158) into branch. Two new lock.yml files added in main (smoke-gemini.lock.yml, smoke-opencode.lock.yml) also had the a+r bug - fixed to a+rX as well. Note: The chmod template is hardcoded in the gh-aw binary itself (v0.71.1), not in any .md file. The lock.yml edits are required to fix the artifact upload failures until the upstream gh-aw binary is updated. Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/a5424e8d-2fff-49d4-a93a-42e216ff0d87 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Done — merged main (3d7741d). Regarding the reviewer's concern about editing lock files directly: the Also caught and fixed 2 new lock.yml files added in main ( |
|
Smoke: Copilot BYOK — Run #25394646947
Running in BYOK offline mode ( Overall: PASS · PR by
|
🔬 Smoke Test Results
PR: fix: chmod -R a+rX to allow directory traversal during artifact upload Overall: PARTIAL — MCP test passed; pre-computed step outputs were not substituted (template vars unexpanded).
|
|
Smoke Test Results ✅ GitHub MCP: Last 2 merged PRs retrieved Status: PASS
|
|
PRs: api-proxy: inject X-Initiator: agent default on all Copilot-bound requests to prevent billing inflation | fix: one-shot-token.so fails to load on musl/Alpine hosts (ARC runners) Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results
Overall: FAIL —
|
All 34 agentic workflow lock files were failing artifact uploads with
EACCES: permission denied, stat '/tmp/gh-aw/sandbox/firewall/audit/...'. AWF runs Docker viasudo, creating root-owned files; the cleanup step usedchmod -R a+rto expose them to therunneruser — buta+rgrants only read permission on directories, not execute (search), so the runner couldn't traverse them.Change
chmod -R a+r→chmod -R a+rXin the "Print firewall logs" step across all 34.lock.ymlfiles (32 existing + 2 added in main:smoke-gemini.lock.yml,smoke-opencode.lock.yml)Xflag adds execute to directories only (not regular files), making them traversable without over-permissioningNote: The
chmod -R a+rtemplate is hardcoded inside the gh-aw compiler binary (v0.71.1), not in any.mdsource file. Direct edits to the lock files are therefore the correct fix within this repository until the upstream gh-aw binary is updated to emita+rX.