Conversation
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
| function repoAbsPath(repoRoot, repoPath) { | ||
| const base = path.resolve(repoRoot); | ||
| const abs = path.join(base, repoPath); | ||
| if (abs !== base && !abs.startsWith(base + path.sep)) return null; | ||
| return abs; | ||
| } |
There was a problem hiding this comment.
Consider also applying the repoAbsPath guard to listEntries (line 676) for defense-in-depth. While current callers pass constants (SKILL_ROOTS), future callers might pass user-derived paths. Applying the same traversal check consistently across all functions that join repoRoot with an external path would make the codebase more robust against future regressions.
|
The fix looks correct for the issue described in this PR. I also considered whether an in-repo symlink pointing outside the repository could bypass this check, since Overall, this addresses the reported path traversal/false-positive issue cleanly. Thanks for the fix and for adding the regression coverage. |
Description
a doc link containing ../ made the check look at files outside the project folder on the CI machine
Type of Change
How Has This Been Tested?
make testpasses locallyChecklist
go fmt,go vet)Thank you to @sourcery-ai for discovering this issue in the action contract.
Related Issues
n/a