Fix the low-severity findings from the 2026-08-25 security audit #17
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/security-audit-low"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What does this PR do?
Second batch from the 2026-08-25 security audit: the Low/Info findings (the four Medium findings landed in #16).
MaxScanBytes(new option, default 8 MiB, validated floor 4096) instead of buffering the entire unread backlog (previously up to 2 GB in one allocation). Capped reads end at the last complete line and the remainder arrives on subsequent scans; a single line larger than the cap is discarded with a warning so the file cannot stall every future scan. Offsets and payload references track actual consumption rather than the file length (also fixes a payload-reference uniqueness collision that partial scans would have introduced).uint.MaxValueskips the folder sweep with a warning instead of wrappinglastUid + 1to UID 0 and issuing an overbroad search.Viegard.Application.Logging.LogSanitizerreplaces control characters with spaces in attacker-influenced strings before they reachILogger: MDaemon file names and IMAP folder names. Syslog logging was reviewed and needs no change - it logs only parsedIPAddressvalues and operator configuration.GetStatsAsyncclampslongcounts instead of casting, so a flooded queue cannot wrap the reported depth/in-flight/dead-letter numbers negative.Microsoft.Extensions.Hosting10.0.10 -> 10.0.11 (the one project a patch behind). The test-tooling major-version jumps flagged by the audit (coverlet 6->10, Test.Sdk 17->18, xunit.runner 3->4) were deliberately not taken in a security batch; they can ride a normal maintenance PR.Also records the schema-change data-migration request in TODO.md (from tonight''s live cutover: an explicit opt-in
ALTER SCHEMA ... RENAMEdesign with fail-closed detection of stranded data; needs a design decision).Deferred audit recommendations (revisit at Phase 9, tracked in TODO.md): audit-record exception text, LISTEN/NOTIFY wakeup spam, secret string zeroization, in-memory ledger doc note.
How was this tested?
dotnet build- 0 errors, 0 warningsdotnet test- 279 passed, 9 skipped (live-PostgreSQL integration tests; local WSL Docker unavailable)Checklist