feat: Performance and security enhancements#3
Merged
Conversation
- Add async runtime support with tokio (optional feature) - Migrate socket operations to async I/O for better concurrency - Optimize buffer sizes from 4KB to 16KB for 4x throughput - Implement multi-threaded session management with Arc<RwLock> - Add socket permission validation (0600 permissions) - Implement session isolation with restrictive umask - Add comprehensive input sanitization and command whitelisting - Add security tests for permissions and input validation - Add performance benchmarks showing 25+ GB/s throughput
- Add #[allow(dead_code)] annotations to async features - Fix unused imports in tests - Gate async-dependent tests with feature flag - Zero compiler warnings remaining
- Add crates.io version badge with link - Document security features and session isolation - Explain input validation and command whitelisting - Add performance optimization details - Document async I/O optional features - Update test documentation with 55+ tests - Clarify that NDS is not a sandbox
- Performance improvements (16KB buffers, async I/O) - Security enhancements (socket permissions, input sanitization) - 55+ tests with comprehensive coverage - Zero compiler warnings
- No more hardcoded version in tests - Accepts any semver format (X.Y.Z) - Future-proof solution
K-NRS
added a commit
that referenced
this pull request
Sep 13, 2025
feat: Performance and security enhancements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces significant performance improvements and security enhancements to the detached-shell project.
Performance Improvements 🚀
Async I/O Support
socket_async.rs- Async socket operationsio_handler_async.rs- Async PTY I/O handlingAsyncSessionManager- Thread-safe session management withArc<RwLock>Buffer Optimization
Security Enhancements 🔐
Socket Permissions
Session Isolation
Input Sanitization
Testing
Security Tests Added
Performance Benchmarks
Compatibility
asyncfeature flagBuild & Test