fix(skills): prevent path traversal in skill install and uninstall#45
Conversation
Skill names containing path components like `../..` could resolve outside the local `skills` root directories, allowing arbitrary directory removal on uninstall or arbitrary writes on install. Add `isPathWithinDirectory` and `isManagedSkillPathContained` guards that reject any skill name whose resolved canonical or target path escapes the expected roots. Improve the unmanaged-skill error message to clarify that only oo-managed skills can be removed. Signed-off-by: Kevin Cui <bh@bugs.cc>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
Summary by CodeRabbit
WalkthroughThis PR adds path validation rules to prevent skill names from escaping the local Codex Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Skill names containing path components like
../..could resolve outside the localskillsroot directories, allowing arbitrary directory removal on uninstall or arbitrary writes on install.Add
isPathWithinDirectoryandisManagedSkillPathContainedguards that reject any skill name whose resolved canonical or target path escapes the expected roots. Improve the unmanaged-skill error message to clarify that only oo-managed skills can be removed.