You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: harden config module against corruption, I/O failures, and silent data loss
Risks discovered in security review and their mitigations:
1. [HIGH] Invalid enum deserialization from manual JSON edits
- Add AppConfig.Sanitize() + AuthCredential.Sanitize() to repair invalid
AuthScheme values and null nested objects on load
2. [HIGH] Narrow exception catch in Load() — only caught JsonException
- Expanded to catch IOException + UnauthorizedAccessException to handle
disk-full and permission-denied scenarios gracefully
3. [HIGH] Fire-and-forget SaveAsync exceptions silently lost
- Added ConfigService.SafeFireAndForgetSave() that logs failures to Trace
- Updated all 12 fire-and-forget call sites in App + 4 ViewModels
4. [MEDIUM] Unnecessary disk write on every startup
- OnAutoUploadEnabledChanged in PatchViewModel constructor triggered
SaveAsync during init. Added _initialized guard to skip during construction
5. [LOW] Corrupted config silently overwrites backup before recovery attempt
- Sanitize() is called on recovered configs before re-saving to disk
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments