Skip to content

Conversation

@cuiyiming007
Copy link

fix: Use path.sep for cross-platform path validation

This PR fixes a security check failure on Windows when installing skills.

The previous implementation used a hardcoded forward slash (/) to validate that the installation path is within the target directory. On Windows, path.resolve returns paths with backslashes (\), causing the startsWith check to fail and triggering the error: Security error: Installation path outside target directory.

Changes

  • Replaced hardcoded '/' with path.sep in src/commands/install.ts to ensure compatibility with the OS-specific path separator.

Related Issue

#17

Verification

  1. Run openskills install <skill> on a Windows machine.
  2. Verify that the installation proceeds without the security error.

Replaced hardcoded forward slash '/' with path.sep in security checks to ensure correct path validation on Windows. This resolves the "Security error: Installation path outside target directory" issue when installing skills on Windows.
@amrpyt
Copy link

amrpyt commented Dec 18, 2025

Tested on Windows - this fix works!
image

Copy link

@Tridu33 Tridu33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants