Skip to content

fix: reject absolute paths in ApplyPatch diffs#412

Open
juliuss007 wants to merge 1 commit into
CortexLM:mainfrom
juliuss007:codex/fix-apply-patch-absolute-path-50105
Open

fix: reject absolute paths in ApplyPatch diffs#412
juliuss007 wants to merge 1 commit into
CortexLM:mainfrom
juliuss007:codex/fix-apply-patch-absolute-path-50105

Conversation

@juliuss007
Copy link
Copy Markdown

@juliuss007 juliuss007 commented May 26, 2026

Summary

  • Reject absolute diff header paths before resolving ApplyPatch targets.
  • Validate resolved patch paths stay under the current workspace for both ApplyPatch implementations.
  • Add regression tests covering absolute new-file patch paths.

Fixes PlatformNetwork/bounty-challenge#50105

Verification

  • cargo +1.91.1 fmt --package cortex-engine --check
  • git diff --check
  • cargo +1.91.1 test -p cortex-engine absolute_new_file_path
  • cargo +1.91.1 test -p cortex-engine apply_patch
  • cargo +1.91.1 check -p cortex-engine

Bounty claim: PlatformNetwork/bounty-challenge#50105

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.

[BUG] [v0.0.7] ApplyPatch cwd.join(patch path) follows POSIX absolute — can write outside workspace`

1 participant