Merge PR #386: fix symlink boundary check prefix confusion in skills_guard
Authored by Farukest. Fixes #385. Replaces startswith() with Path.is_relative_to() in _check_structure() symlink escape check — same fix pattern as skill_view() (PR #352). Prevents symlinks escaping to sibling directories with shared name prefixes.
This commit is contained in:
commit
44a2d0c01f
3 changed files with 292 additions and 2 deletions
|
|
@ -743,7 +743,7 @@ def _check_structure(skill_dir: Path) -> List[Finding]:
|
|||
if f.is_symlink():
|
||||
try:
|
||||
resolved = f.resolve()
|
||||
if not str(resolved).startswith(str(skill_dir.resolve())):
|
||||
if not resolved.is_relative_to(skill_dir.resolve()):
|
||||
findings.append(Finding(
|
||||
pattern_id="symlink_escape",
|
||||
severity="critical",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue