Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(security): sanitize paths and prevent shell scripts #33

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Conversation

wellwelwel
Copy link
Owner

@wellwelwel wellwelwel commented Feb 28, 2024

New Protective Measures

  • Blocks access above target directory by filtering ../ and / paths, for example:
    • /root will be sanitized to ./root
    • ../../etc/secret will be sanitized to ./etc/secret
  • Normalizes paths according to the OS, allowing all collaborators to use the same path, each using their own OS:
    • \ for Windows
    • / for Linux and macOS
  • Normalizes paths by filtering unusual path characters, for example:
    • <>:|^?*
  • Prevents shell scripts by setting shell to false in spawn options, ensuring that only secure arguments will be used.

@wellwelwel wellwelwel merged commit 39f7d8c into main Feb 28, 2024
25 checks passed
@wellwelwel wellwelwel deleted the security branch February 28, 2024 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant