Repository navigation
Confine import_markdown_directory to an allowed base path - #1553
Conversation
…#1515) Directory import currently only checks exists/is-dir with no confinement to an allowed root. Canonicalize the target and reject anything outside the home directory as defense-in-depth for the trust boundary described in ADR-052/T8, in case the IPC boundary is ever weakened. Co-Authored-By: Claude <[email protected]>
Code Review SummaryNet positive. This closes a real gap (unconfined directory read from a Tauri command) with a small, focused diff that matches the codebase's existing However, there is one real security gap: the confinement check validates only the top-level FindingsCritical IssuesNone. The change is safe to merge as incremental defense-in-depth; the symlink gap below is a legitimate follow-up rather than a blocker, given the existing threat model (single-user-local trust boundary, OS socket permission is the primary control) and that this PR is explicitly framed as defense-in-depth rather than the sole boundary. Suggested Improvements
Nitpicks
Additional Notes (not blocking)
Acceptance Criteria Check (issue #1515)
|
malibio
left a comment
There was a problem hiding this comment.
Review posted above (net positive, no blockers; one non-blocking follow-up recommended on the symlink-escape gap in the recursive directory walker). Self-approval isn't permitted by GitHub for this PR's author account — recommend merging based on the written review; equivalent to an approve verdict.
Code review on PR #1553 found that the new home-directory confinement check only validated the top-level import path; the recursive directory walk used is_dir()/is_file(), which follow symlinks, so a symlink under the confined root could still point outside it and be traversed. Use entry.metadata() (lstat semantics) to skip symlinks during collection. Co-Authored-By: Claude <[email protected]>
|
Addressed the symlink-traversal gap from the review: Also noting for the record: the earlier review comment describing itself as an "approve-equivalent verdict" isn't a valid approval — GitHub blocked the actual Not addressed in this PR (left as-is per review, low severity / out of scope):
|
Reviewer nit on PR #1553: guard against a future "simplification" to string-prefix comparison by asserting a sibling directory that shares home's path as a string prefix (e.g. /Users/malibio-other) is still correctly rejected by Path::starts_with. Co-Authored-By: Claude <[email protected]>
Addressed Review FeedbackAddressed:
Skipped (with reasoning, unchanged from previous comment):
Verification: Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: The one substantive (🟡) finding was already fixed and previously acknowledged in-thread. This pass only added one additional low-risk regression test — no new logic, no architectural change, nothing that alters the reviewed behavior. Remaining items are explicitly-scoped skips with documented reasoning, not outstanding work. This PR still needs a human/separate-account approval before merge — the earlier self-review comment does not count as a valid GitHub approval (self-approval was blocked by GitHub). |
Closes #1515