Skip to content

security: add path traversal protection to installers#1

Open
asharijuang wants to merge 2 commits intomainfrom
security/path-traversal-and-supply-chain-hardening
Open

security: add path traversal protection to installers#1
asharijuang wants to merge 2 commits intomainfrom
security/path-traversal-and-supply-chain-hardening

Conversation

@asharijuang
Copy link
Copy Markdown
Member

Summary

  • Add input sanitization (validate_safe_name / validate_safe_path) for skill names and file paths in install.sh and install.ps1
  • Prevents path traversal attacks via malicious GitHub API responses or crafted skill names (e.g. ../../.ssh/authorized_keys)
  • Add SECURITY.md with contributor security checklist and recommended secure installation method
  • Add security note in README.md installation section

Vulnerabilities Addressed

  • Path traversal via skill names: Skill names from GitHub API were used directly in rm -rf, cp -R, mkdir -p, and curl -o without validation. A compromised repo could inject names like ../../etc to write/delete files outside the target directory.
  • Path traversal via file paths: Relative file paths from the GitHub tree API were passed to file operations without checking for .. sequences or absolute paths.

Changes

File What
install.sh Added validate_safe_name() and validate_safe_path() functions, applied at 4 code paths
install.ps1 Added Test-SafeName and Test-SafePath functions, applied at skill listing and file install
SECURITY.md New file — reporting policy, security model, contributor checklist
README.md Added security note pointing to SECURITY.md

Test plan

  • Run ./install.sh locally — verify normal skill installation still works
  • Run install.ps1 on Windows — verify normal installation still works
  • Verify skill names with special characters (e.g. ../test, foo bar) are rejected with error message

aguunng and others added 2 commits April 10, 2026 05:36
…tallers

Skill names from GitHub API responses and local filesystem are now validated
to contain only safe characters (alphanumeric, hyphens, underscores). File
paths are checked for traversal sequences (..) and absolute paths before
use in rm -rf, cp, mkdir, and curl operations. Adds SECURITY.md with
guidance for contributors and users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants