Repository navigation
Clear AUTHINFO credentials before returning pooled buffers - #208
Merged
enteriaza merged 3 commits intoOct 19, 2026
Conversation
Zero credential-bearing command buffers before returning them to the array pool, including when writes fail or are cancelled. Clear the separate encoded credential copy and add regression coverage for buffer cleanup, wire framing, and log redaction.
Capture structured per-attempt establishment outcomes, failure reasons, elapsed times, and pool counts when concurrency assertions fail. Preserve existing assertions and production behavior to help diagnose intermittent Linux CI failures.
Replace the manually filtered loop with predicate-based Count while preserving ordinal backbone matching and failure diagnostics.
enteriaza
deleted the
163-bug-security-authinfo-password-is-returned-to-arraypool-without-clearing
branch
October 19, 2026 18:26
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
Fix credential exposure in
NntpProviderSession.WritePrefixedAsync, whereAUTHINFO PASScommand buffers were returned toArrayPool<byte>.Sharedwithout clearing their contents.Password bytes could remain in pooled memory after authentication, potentially exposing them to subsequent renters within the same process.
Closes #163
Changes
clearArray: trueto clear the entire array, including unused capacity.ArrayPool<byte>.Shared.ArrayPool<byte>seam to verify cleanup deterministically.Validation
Security verification
Tests use a controlled pool to inspect the buffer at return time, avoiding reliance on nondeterministic reuse of the shared pool.
The tests verify that credential-bearing buffers are cleared on success, write failure, and cancellation, and that debug logging redacts the password.
The local CodeQL scan reported no new result on
NntpProviderSession.cs. GitHub's CodeQL scan has not yet run against this change.Scope and limitations
This change prevents credentials from remaining in returned pooled buffers and clears the temporary encoded credential copy. The configured password string remains in memory for the session lifetime; this PR does not attempt to eliminate all in-memory representations of configured credentials.