fix(installer): guard artifact target paths#162
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds input validation to the skill installation script to prevent unsafe artifact names and destination path traversal. A new regex pattern defines allowed artifact name characters, two guard functions validate names and paths, the path computation integrates these checks, and main catches validation errors to exit cleanly. ChangesPath and name validation
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
What this PR does
namevalues before using them in installer destination paths.Kind of change
Checklist
LESSON_TEMPLATE.mdstructure[Name](phases/...)), not bare textdocs/en.mdclaimsPhase / lesson
Installer tooling:
scripts/install_skills.py.Notes for reviewer
install_skills.pyuses artifact metadata to derive output paths. This keeps valid slug-style artifact names working as before, while rejecting names with path separators,..-style traversal, drive-like values, or hidden/empty names before files are copied.Duplicate check: searched open and recent PRs/issues for
install_skills, target paths, path traversal, and artifact-name sanitization; no overlapping fix found.Validation
python -m py_compile scripts/install_skills.pypython scripts/install_skills.py _tmp-install-preview --type all --layout flat --dry-run../escape,sub/name,.hidden,C:drive, and empty names are rejectedpython scripts/audit_lessons.pypython scripts/check_readme_counts.pygit diff --check