fix: security hardening, null array fix, and test coverage#17
Conversation
… features - Add path traversal validation in findSkillDir and listSkillsInDir to reject skill names containing ".." (prevents directory escape from cache root) - Fix JSON null arrays: initialize enabledAdapters and inject results as empty slices so JSON output emits [] instead of null - Add 16 new tests covering status command, isJSONMode, ExitCoder interface, git quiet mode, path traversal rejection, detectCurrentBranch edge cases, isGitRepo, and ScanPathError formatting Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces path traversal protections in git provider skill resolution functions and comprehensive test coverage for status command functionality and git provider behavior. Slice initialization in main.go is refactored to use non-nil empty slices. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fix: security hardening, null array fix, and test coverage
fix: security hardening, null array fix, and test coverage
Summary
findSkillDirandlistSkillsInDir— skill names containing..are rejected to prevent directory escape from cache rootenabledAdaptersand injectresultsas empty slices so JSON output emits[]instead ofnullTest plan
go vet ./...— cleango test ./... -count=1— 29/29 packages passgofmt— cleango build— clean🤖 Generated with Claude Code
Summary by CodeRabbit
Security
Bug Fixes
Tests