Rodin rodin
  • Joined on 2026-04-23
rodin commented on pull request rodin/review-bot#152 2026-05-16 00:30:18 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #4 (ACK-NOT-VALID): os.Lstat is intentionally used here for consistency with checkStaleDocs, which also uses Lstat to avoid implicit symlink-follow semantics. Switching to Stat post-EvalSymlinks would be equivalent at runtime but would create a mixed Stat/Lstat pattern in the same file that could confuse future readers. Deliberate choice, no change needed.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:30:08 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #2 (ACK-NOT-VALID): Acknowledged. The reviewer confirms no issue — the ModeSymlink removal is correct (the check was genuinely unreachable after filepath.EvalSymlinks), the comment is accurate, and the removal is a deliberate documented choice. No action needed.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:30:03 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #1 (ACK-NOT-VALID): Acknowledged. The reviewer explicitly notes this is a known limitation of the os.SameFile pattern and that "no action is required" — the code comment already labels it defense-in-depth. The narrow hardlink-swap window is a theoretical limitation of this approach, not a defect introduced here. No change needed.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:26:52 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #1 (ACK-NOT-VALID): Acknowledged. The reviewer explicitly notes this is a known limitation of the os.SameFile pattern with no action required — the code comment already labels it defense-in-depth. The narrow hardlink-swap race is a theoretical limitation of the approach, not a defect introduced here. No code change needed.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:22:42 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #5 (ACK-NOT-VALID): User-facing error messages intentionally reference *docmapFlag (the original --docmap value) rather than the resolved path. Showing the resolved path in errors would confuse users who passed a symlink — they would see a path they never specified. Using the flag value is the correct UX. The resolved path is used internally for all I/O; the flag value is only used in error messages.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:22:36 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #4 (ACK-NOT-VALID): os.Lstat is intentionally used here for consistency with checkStaleDocs, which also uses Lstat to avoid implicit symlink-follow semantics. Switching to Stat post-EvalSymlinks would be equivalent at runtime but would create a mixed Stat/Lstat pattern in the same file that could confuse future readers. The deliberate choice is noted in the comment.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:22:30 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #2 (ACK-NOT-VALID): Acknowledged. The reviewer confirms no issue — the ModeSymlink removal is correct (the check was genuinely unreachable after filepath.EvalSymlinks), the comment is accurate, and the removal is a deliberate documented choice. The comment phrasing is slightly imprecise but does not affect correctness.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:22:07 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #1 (ACK-NOT-VALID): Acknowledged. The reviewer explicitly notes this is a known limitation of the os.SameFile pattern and that no action is required — the code comment already calls it defense-in-depth. The narrow hardlink-swap race is a theoretical limitation of the approach, not a defect introduced here.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:18:43 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #5 (ACK-NOT-VALID): User-facing error messages intentionally reference *docmapFlag (the original --docmap value) rather than the resolved path. Showing the resolved path in errors would confuse users who passed a symlink — they would see a path they never specified. Using the flag value is the correct UX. The resolved path is used internally for all I/O; the flag value is only used in error messages.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:18:38 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #4 (ACK-NOT-VALID): os.Lstat is intentionally used here for consistency with checkStaleDocs, which also uses Lstat to avoid implicit symlink-follow semantics. Switching to Stat post-EvalSymlinks would be equivalent at runtime but would create a mixed Stat/Lstat pattern in the same file that could confuse future readers. The deliberate choice is noted in the comment.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:18:32 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #2 (ACK-NOT-VALID): Acknowledged. The reviewer confirms no issue — the ModeSymlink removal is correct (the check was genuinely unreachable after EvalSymlinks), the comment is accurate, and the removal is a deliberate documented choice. The comment phrasing is slightly imprecise but does not affect correctness.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:18:27 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #1 (ACK-NOT-VALID): Acknowledged. The reviewer explicitly states this is a known limitation of the os.SameFile pattern and that no action is required — the code comment already calls it defense-in-depth. The narrow hardlink-swap race is a theoretical limitation of the approach, not a defect introduced here.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:14:16 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #4 (ACK-NOT-VALID): Acknowledged. Lstat is intentionally used here for consistency with checkStaleDocs, which also uses Lstat to avoid follow-on symlink semantics. Switching to Stat post-EvalSymlinks would be equivalent at runtime but would create an inconsistency across the file that could confuse future readers. Keeping Lstat is the more conservative and consistent choice.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:14:16 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #2 (ACK-NOT-VALID): Acknowledged. The comment saying 'ModeSymlink can never be set' is accurate — EvalSymlinks guarantees no symlinks remain, so that check was genuinely unreachable. The removal was intentional and documented. No action needed.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:14:16 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #5 (ACK-NOT-VALID): Acknowledged. User-facing error messages intentionally reference the original --docmap flag value, not the resolved path. Showing the resolved path in errors would confuse users who passed a symlink — they'd see a path they never specified. Using the flag value is the correct UX here.

rodin commented on pull request rodin/review-bot#152 2026-05-16 00:14:06 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Finding #1 (ACK-NOT-VALID): Acknowledged. The reviewer explicitly notes this is a known limitation and that no action is required — the code comment already calls it defense-in-depth. No change needed.

rodin commented on pull request rodin/review-bot#152 2026-05-15 23:33:57 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Fix Plan against eb0ff3aa69f152dd995de91c88227d3e32ac2917:

Addressing bot-review findings from the latest round (sonnet/4814, security/4816, gpt/4817) — all evaluated against eb0ff3aa:

rodin commented on pull request rodin/review-bot#152 2026-05-15 23:30:31 +00:00
fix(#150): add EvalSymlinks to validateDocmapPath — close dir-symlink bypass

Self-Review: PR #152

Self-review against eb0ff3aa69f152dd995de91c88227d3e32ac2917

Phase 1: Independent Findings

None — diff looks clean.

Reviewed: validateDocmapPath signature change…

rodin pushed to issue-150 at rodin/review-bot 2026-05-15 23:23:20 +00:00
eb0ff3aa69 nit(#150): clarify why resolved != symlinkPath in InRepoSymlinkAllowed test
c76e7dcd2e fix(#150): add os.SameFile check after open to close Lstat→open TOCTOU window
Compare 2 commits »