Repository navigation
fix: harden temporary artifact handling - #8663
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Reused directory permissions can expose sensitive endpoints, and early failures leak auto-created directories.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Hardens temporary work directories and audit artifact writes against predictable paths and symlink attacks.
Changes:
- Creates default work directories atomically and validates reused directories.
- Adds descriptor-based, no-follow artifact writing and regression coverage.
- Tightens ACL assertions, fixtures, and workflow permissions.
| File | Description |
|---|---|
src/test-helpers/config-writer-test-harness.test-utils.ts |
Adapts ownership simulation. |
src/ssl-key-storage.test.ts |
Uses synthetic mocked paths. |
src/squid/acl-generator.test.ts |
Uses exact ACL assertions. |
src/fs-utils.ts |
Adds secure file writer. |
src/docker-manager-coverage.test.ts |
Isolates temporary fixtures. |
src/docker-manager-cleanup.test.ts |
Isolates cleanup fixtures. |
src/container-startup-diagnostics-coverage.test.ts |
Removes redundant substring assertions. |
src/config-writer.ts |
Validates ownership and reuses secure writer. |
src/config-writer.test.ts |
Updates ownership mocking. |
src/config-writer-new-branches.test.ts |
Covers ownership and permissions. |
src/commands/main-action.ts |
Creates unique defaults and securely writes markers. |
src/commands/main-action.test.ts |
Tests default-directory and marker behavior. |
src/commands/main-action.test-utils.ts |
Updates synthetic work directory. |
src/commands/main-action-security.test.ts |
Adds symlink regression coverage. |
src/commands/main-action-fs-mock.test-utils.ts |
Mocks atomic directory creation. |
src/cli-options.ts |
Removes predictable timestamp default. |
.github/workflows/pr-title.yml |
Grants pull-request read permission. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ Copilot review passed with no inline comments. @pelikhan Add the |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (6 files)
Coverage comparison generated by |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Warning Firewall blocked 8 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "msfeed25.pkgs.visualstudio.com"
- "update.googleapis.com"
- "www.google.com"
- "www.gstatic.com"See Network Configuration for more information.
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
🚀 Security Guard has started processing this pull request |
|
❌ Smoke Gemini reports failed. Facets need polishing...
|
|
❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...
|
|
✅ Build Test Suite completed successfully!
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤
|
|
📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident...
|
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.
|
|
✅ Smoke Claude passed Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
Smoke Test: Copilot BYOK (Direct) Mode ✅Test Results:
Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY) → api-proxy → api.githubcopilot.com Status: PASS Assignees:
|
|
EGRESS_RESULT allow=pass deny=pass ✅ Allowed domain (github.com) reachable: Overall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "example.com"See Network Configuration for more information.
|
|
Smoke Test: Copilot Engine —
Overall: PASS
|
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.anthropic.com"See Network Configuration for more information.
|
Smoke Test: API Proxy OpenTelemetry Tracing — Results
Summary: All applicable scenarios passed. OTEL tracing integration is working as expected.
|
Smoke Test: Services Connectivity — PASS ✅
Overall: PASS
|
|
Merged PRs: "Fix Refactoring Scanner safe-output fallback"; "Fix Duplicate Code Detector Copilot model" Warning Firewall blocked 8 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "accounts.google.com"
- "android.clients.google.com"
- "clients2.google.com"
- "contentautofill.googleapis.com"
- "msfeed25.pkgs.visualstudio.com"
- "update.googleapis.com"
- "www.google.com"
- "www.gstatic.com"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Notes:
|
Chroot Version Comparison
Overall result: ❌ Not all tests passed (Node.js version mismatch between host and chroot environment). Skipping the
|


Summary
Remediates every finding tracked by github/vuln-mgmt#251067 for
github/gh-aw-firewall.mkdtempSync; validates reused directories as real directories with trusted root/SUDO_UID-aware ownership and rejects group/world-writable modes.enclave-audit-incomplete.txtthrough the shared descriptor-based no-follow writer withfstat,fchmod,fsync, and guaranteed close; adds a real-filesystem symlink regression proving the external target remains unchanged./tmpfixtures in the implicated main-action, Docker cleanup/coverage, and SSL key-storage tests; real filesystem cases now use uniquemkdtempSyncparents with reliable cleanup while fully mocked cases use explicit synthetic paths.pull-requests: readpermissions to the pinned PR-title workflow.Validation
npm run lint -- --quietnpm run type-checknpm run buildactionlint .github/workflows/pr-title.ymlsudo/Docker and failed because this host prompts for a sudo password.A subsequent GitHub CodeQL scan is required to formally close the eight test-only alerts; no false-positive dismissal should be necessary because the flagged assertion patterns were removed.