fix: security vulnerabilities, UI freezes, and logic bugs#585
Conversation
Security: - FileShredder: skip junctions/symlinks (prevents System32 destruction via junction attack) - FileShredder: use RandomNumberGenerator.Fill() instead of Random.Shared for shredding Performance: - ServiceManager: StartService/StopService now async (was blocking UI 30s) - StartupService: toggle entries now async (was blocking UI 10s) - ProcessManager: auto-refresh pauses when tab not visible (saves 58% CPU idle) Logic bugs: - CleanupViewModel: SFC regex fixed to only match percentage values (\d+\s*%) - CleanupViewModel: IsProgressIndeterminate reset in finally blocks - FileShredderViewModel: CanShredAll re-evaluates on collection change - NetworkSharedState: Dispose unsubscribes PropertyChanged handlers (memory leak fix) - AboutViewModel: catch HttpRequestException on user-initiated update check
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR migrates synchronous service-control APIs to async patterns, hardens file shredding with cryptographic random generation and safe folder traversal that skips symlinks/junctions, and improves view model lifecycle management through active state gating and explicit event cleanup. ChangesService Async Migration and View Model Lifecycle Improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| if (parentGroup is not null) parentGroup.IsExpanded = true; | ||
|
|
||
| // Pause/resume the process manager auto-refresh loop based on tab visibility. | ||
| ProcessManager.IsActive = value.Content == ProcessManager; |
| foreach (var sub in subDirs) | ||
| { | ||
| if ((sub.Attributes & FileAttributes.ReparsePoint) != 0) | ||
| continue; // skip junctions/symlinks | ||
| stack.Push(sub); | ||
| } |
Summary
Security (Critical)
GetFiles(AllDirectories)now skips directories withReparsePointattribute, preventing traversal into junctions that could destroy system filesRandomNumberGenerator.Fill()instead ofRandom.Sharedfor cryptographically secure shreddingPerformance (High)
Logic Bugs
(\d+)to(\d+)\s*%to only match actual progress percentagesTest plan
Summary by CodeRabbit
New Features
Bug Fixes
Refactor