Skip to content

fix: anchor PAC paths to the trusted task cache - #1477

Merged
Gene Chu (genec314) merged 2 commits into
mainfrom
fix/pac-path-provenance
Sep 10, 2026
Merged

fix: anchor PAC paths to the trusted task cache#1477
Gene Chu (genec314) merged 2 commits into
mainfrom
fix/pac-path-provenance

Conversation

@genec314

Copy link
Copy Markdown
Contributor

Summary

  • Replace substring-based PAC path validation with validation anchored to the executing task bundle's task cache.
  • Require exact installer/version/bin layout, validate canonical filesystem containment and executable shape, and cache the canonical runner directory.
  • Add native filesystem regression fixtures for repository-local imitations, invalid path shapes, links, and directory identity.

Tasks affected

The shared runner parameters are used by 32 PAC-consuming v2 tasks, including credential-free pack/unpack tasks. Installer import and credential-only task behavior remain unchanged.

Architecture impact

No task inputs, service-connection schemas, authentication flows, or dependencies are changed. Validation remains lazy; the runner directory getter now retains the validated canonical path. Existing Windows/Linux platform layouts are retained.

Known limitations / follow-ups

This is a draft, not release-ready sign-off.

  • Dependencies could not be restored because the locked package-feed download timed out and direct public npm access failed TLS negotiation. The locked CLI wrapper implementation remains unavailable for executable-selection and pre-spawn contract inspection.
  • Default deployed-location/getter, canonical caching, runner-boundary, and emitted-bundle coverage still need completion.
  • Native Windows case-sensitive installer/bin sibling and drive/share-alias coverage remains incomplete.
  • The task cache, executable, and support files must be protected from attacker modification. Path validation is not protection against same-user file replacement or check/use races.

Test plan

  • Focused static source review; no high-confidence defect identified within the documented protected-cache trust model.
  • Execute the focused path/getter/runner/bundle regressions.
  • Run the existing unit suite, lint, TypeScript check, and build.
  • Inspect the locked wrapper and emitted/packaged runtime layout.
  • Run an authorized DEV-stage pipeline and complete native Windows/Linux coverage.

No tests, builds, or PAC were executed locally; execution-based validation was explicitly deferred.

Resolve the PAC installation from the executing task's cache, validate filesystem containment, and retain the canonical runner directory. Add native filesystem regressions for path imitations, links, and directory identity.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@genec314
Gene Chu (genec314) marked this pull request as ready for review September 9, 2026 17:19
Capture and narrow thrown errors explicitly instead of reading assert.throws' void-typed result. Preserve message, filesystem-code, and error-identity assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@genec314

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@genec314
Gene Chu (genec314) enabled auto-merge (squash) September 10, 2026 18:09
@genec314
Gene Chu (genec314) merged commit 6e6fea9 into main Sep 10, 2026
5 checks passed
@genec314
Gene Chu (genec314) deleted the fix/pac-path-provenance branch September 10, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants