Skip to content

Conversation

SteveFunso
Copy link

No description provided.

This commit introduces several improvements to the ssh-mcp-server: 1. **On-Demand SSH Connections:** The connection strategy has been changed from connecting to all servers on startup to connecting on-demand. This improves startup time and reduces resource consumption, especially when many servers are configured. 2. **Fix Resource Leaks:** The file upload and download methods have been updated to properly close SFTP sessions and file streams. This prevents resource leaks that could lead to performance degradation over time. 3. **Robust Server Info Listing:** The `getAllServerInfos` method has been refactored to ensure it correctly maps server configurations to their connection status, making it more reliable.
This commit introduces several security enhancements to the ssh-mcp-server: 1. **Prevent Path Traversal:** Added input sanitization to the `upload` and `download` methods to prevent path traversal attacks on the local filesystem. 2. **Disallow Command Chaining:** The command validation logic has been improved to reject commands containing shell metacharacters like `;`, `&`, and `|`, preventing command injection through command chaining. 3. **Add Security Warning:** The server now logs a warning on startup if no command whitelist is configured, advising you to set one up. 4. **Document Security Risks:** A new "Security Considerations" section has been added to the README to inform you about potential risks and best practices.
@classfang classfang merged commit 8b98160 into classfang:main Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants