Skip to content

Comments

add canonical path validation to skill loader#322

Merged
bug-ops merged 3 commits intomainfrom
feat/m14/skill-path-canonicalize
Feb 15, 2026
Merged

add canonical path validation to skill loader#322
bug-ops merged 3 commits intomainfrom
feat/m14/skill-path-canonicalize

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 15, 2026

Summary

  • Add validate_path_within to skill loader that canonicalizes paths and verifies they stay within the skills base directory
  • Integrate validation in SkillRegistry::load before reading skill metadata, rejecting symlinks that escape the skills directory
  • Add unit tests for symlink-based path traversal rejection and legitimate path acceptance

Closes #307

Test plan

  • cargo nextest run -p zeph-skills — 67 tests pass
  • cargo clippy --workspace -- -D warnings — clean

@github-actions github-actions bot added size/M skills SKILL.md system rust labels Feb 15, 2026
@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2026

Codecov Report

❌ Patch coverage is 73.91304% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/zeph-skills/src/loader.rs 76.19% 10 Missing ⚠️
crates/zeph-skills/src/registry.rs 50.00% 2 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #322      +/-   ##
==========================================
- Coverage   80.32%   80.32%   -0.01%     
==========================================
  Files          99       99              
  Lines       24053    24099      +46     
==========================================
+ Hits        19321    19357      +36     
- Misses       4732     4742      +10     
Files with missing lines Coverage Δ
crates/zeph-skills/src/registry.rs 90.37% <50.00%> (-0.89%) ⬇️
crates/zeph-skills/src/loader.rs 96.32% <76.19%> (-3.29%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bug-ops bug-ops force-pushed the feat/m14/skill-path-canonicalize branch from 5feefca to 2737b2b Compare February 15, 2026 13:22
@bug-ops bug-ops enabled auto-merge (squash) February 15, 2026 13:22
@bug-ops bug-ops merged commit 1c10345 into main Feb 15, 2026
18 checks passed
@bug-ops bug-ops deleted the feat/m14/skill-path-canonicalize branch February 15, 2026 13:34
@bug-ops bug-ops mentioned this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden skill loader with canonical path validation

2 participants