fix: use os.sep in skill_view path boundary check for Windows compatibility

This commit is contained in:
Farukest 2026-03-04 06:50:06 +03:00
parent 556a132f2d
commit e86f391cac
No known key found for this signature in database
GPG key ID: 73E2756B3FFF5241
2 changed files with 127 additions and 1 deletions

View file

@ -458,7 +458,7 @@ def skill_view(name: str, file_path: str = None, task_id: str = None) -> str:
try:
resolved = target_file.resolve()
skill_dir_resolved = skill_dir.resolve()
if not str(resolved).startswith(str(skill_dir_resolved) + "/") and resolved != skill_dir_resolved:
if not str(resolved).startswith(str(skill_dir_resolved) + os.sep) and resolved != skill_dir_resolved:
return json.dumps({
"success": False,
"error": "Path escapes skill directory boundary.",