Copilot · GitHub

Copilot AI linked an issue

Aug 6, 2026

that may be closed by this pull request

Closed

…ensitive paths
- Add validateUploadSourcePath/validateSourcePath helpers that reject paths
  under /etc, system dirs, .git directory components, and HOME credential
  locations (.ssh, .aws, .gnupg, .docker, etc.)
- Add validateAllowedRoot to restrict absolute paths to staging dir,
  GITHUB_WORKSPACE, and RUNNER_TEMP only
- Canonicalize paths with fs.realpathSync before policy checks to prevent
  traversal escapes and symlink chains
- Apply restrictive permissions (0o600) on all staged files in both
  safe_outputs_handlers.cjs and upload_artifact.cjs copySingleFileToStaging
- Clean up upload and download temp directories in artifact_client.cjs
  using try/finally blocks in success and failure paths
- Add security tests covering /etc rejection, .git component rejection,
  out-of-bounds root rejection, allowed workspace paths, and 0o600 perms
- Update auto-copy tests to set GITHUB_WORKSPACE so they match the new
  allowed-roots policy
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…alpathSync error
- Use canonicalFilePath (not filePath) in the allowed-root error message so the
  resolved path is always shown, preventing misleading messages on traversals
- Replace silent path.resolve fallbacks with explicit errors when fs.realpathSync
  fails, eliminating any risk of a non-canonical path bypassing validation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI changed the title [WIP] Restrict safe-output artifact uploads to explicit canonical roots fix(safe-outputs): restrict upload_artifact to canonical allowed roots, reject sensitive paths

Aug 6, 2026

@pelikhan

pelikhan marked this pull request as ready for review

August 6, 2026 05:51

Copilot AI balanced review requested due to automatic review settings

August 6, 2026 05:51

Closed

github-actions[bot]

github-actions[bot]

github-actions[bot]

@pelikhan

@github-actions

Closed

… recursive copy
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…puts_handlers
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Closed

@pelikhan

@pelikhan

pelikhan deleted the copilot/restrict-artifact-uploads branch

August 6, 2026 06:33

Read the original on github.com ↗