Repository navigation
Conversation
On Windows, path.relative() returns an absolute target when the resolved path sits on a different drive or UNC share, and such a relation cannot start with "..". Every containment check that only looked for ".." therefore admitted a target outside its declared root: Build Result stores, Runtime work directories and CLI result exports. Build ids also admitted ':', letting an id like "d:build" resolve as a drive-relative path on Windows. Reject absolute relations at each check and ':' in Build ids. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
SanHsien
added a commit
to SanHsien/hypit
that referenced
this pull request
Oct 28, 2026
…containment Port of upstream PR hypit-ai#442 (issue hypit-ai#450, head 3e2399d); the diff does not apply here, and this fork's store is packages/build-result (upstream: packages/result). On Windows relative() returns an absolute path when the target is on another drive or a UNC share, which never starts with "..", so the containment checks in build-result/store.ts (two), cli/result-export.ts and runtime-local/config.ts accepted it. A build id such as "d:build" is drive-relative and resolve() takes it off the root. Reject `:` in build ids (generated ids are bld_<digits>T<digits>Z_<nonce>, no colon) and add isAbsolute(relation) to each check. The build-id test from the PR failed before the fix and passes after; the containment helpers are not exported, so the isAbsolute additions are covered by review and type check only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
SanHsien
added a commit
to SanHsien/hypit
that referenced
this pull request
Oct 28, 2026
…i#447-hypit-ai#456; advance watermarks PRs hypit-ai#442, hypit-ai#443 and hypit-ai#444 were ported ahead of upstream (d5afdfe, 541ab59, 5dc763c) because the fork has the same defect and it is reachable from outside input. The rest are recorded with the fork-side evidence and a re-review trigger in docs/fork/DECISIONS.md. Release track unchanged at v0.3.1; watermarks PR 455, issue 456. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #450
Summary
Windows-only containment escapes — POSIX behavior unchanged:
path.relative()returns an absolute path when the target resolves on a different drive or a UNC share, and an absolute relation can never start with... Containment checks that only testedrelation === ".."/startsWith(".." + sep)therefore admitted targets outside their declared root:containedResultPathandbuildResultDirectoryinpackages/result/src/node/store.ts,buildWorkPathinpackages/runtime-local/src/config.ts, andcontainedPathinpackages/cli/src/result-export.ts. Each now also rejectsisAbsolute(relation)— the checklocation.tsalready does correctly.assertBuildIdinpackages/protocol/src/build-id.tsrejected/,\, NUL and dot-directories but not:, sod:buildwas a legal Build id — whichresolve()treats as drive-relative on Windows, escaping the work/result root.:is now forbidden alongside the other path characters.Behavior relative to main
resolve(root, build)cross-drive (C:\root,D:\x)relative()→D:\x, passes..check, escapes rootd:buildassertBuildIdthrowsRed / green
packages/protocol/test/canonical.test.ts:c:andd:buildadded to the rejecting Build id cases — on main both passedassertBuildId. TheisAbsolute(relation)branches are Windows-only reachable, so the behavioral regression coverage lives there; the POSIX code path is unchanged.Verification
node --import tsx --test packages/protocol/test/canonical.test.ts— pass.pnpm check— clean.path.win32.relativesemantics (returns absolute target, never..-prefixed).Merge Danger
:are now rejected (they were already unusable as single filesystem names on Windows).Checklist
Generated with Devin