Skip to content

Fix path boundary validation in resolveWithin (fixes #22826) - #22827

Open
arthurianresolve wants to merge 1 commit into
desktop:developmentfrom
arthurianresolve:fix/22826-resolvewithin-path-boundary
Open

arthurianresolve wants to merge 1 commit into
desktop:developmentfrom
arthurianresolve:fix/22826-resolvewithin-path-boundary

Conversation

@arthurianresolve

Copy link
Copy Markdown

Fixes #22826

Description

  • Require a canonical resolved path to equal the canonical root or begin with the root plus a path separator.
  • Reject existing sibling paths whose names merely share the root's string prefix.
  • Add a regression test for the prefix-colliding sibling case.

Testing

  • node script/test.mjs app/test/unit/path-test.ts — 7 tests passed.

Screenshots

Not applicable; this change does not affect the UI.

Release notes

Notes: no-notes

@github-actions github-actions Bot added external Pull request originating outside of the Desktop core team needs-triage labels Sep 7, 2026
@arthurianresolve
arthurianresolve marked this pull request as ready for review September 7, 2026 14:26
@arthurianresolve
arthurianresolve requested a review from a team as a code owner September 7, 2026 14:26
@github-actions github-actions Bot added ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed needs-triage labels Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review.

Note: We still encourage linking to an issue with the help wanted label when possible, as it helps us prioritize and track contributions.

@arthurianresolve

Copy link
Copy Markdown
Author

Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review.

Note: We still encourage linking to an issue with the help wanted label when possible, as it helps us prioritize and track contributions.

as issue was reported through GitHub CLI instead of the form, setting the label was not possible, as it requires repo admin rights

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused fix correctly addresses the boundary bug and includes appropriate regression coverage.

Pull request overview

Fixes resolveWithin path-boundary validation to reject prefix-colliding sibling paths.

Changes:

  • Enforces separator-aware canonical path containment.
  • Adds regression coverage for sibling-prefix collisions.
File summaries
File Description
app/src/lib/path.ts Corrects canonical containment validation.
app/test/unit/path-test.ts Tests rejection of prefix-colliding siblings.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@arthurianresolve arthurianresolve changed the title Fix path boundary validation in resolveWithin Fix path boundary validation in resolveWithin (fixes #22826) Sep 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Pull request originating outside of the Desktop core team ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resolveWithin accepts an existing sibling path that shares the root's string prefix

2 participants