Prevent out-of-bounds header protection sample reads - #6310
Open
SanthoshShetty (Santhosha-bk) wants to merge 1 commit into
Open
Prevent out-of-bounds header protection sample reads#6310SanthoshShetty (Santhosha-bk) wants to merge 1 commit into
SanthoshShetty (Santhosha-bk) wants to merge 1 commit into
Conversation
SanthoshShetty (Santhosha-bk)
requested review from
Anthony Rossi (anrossi) and
Guillaume Hetier (guhetier)
September 7, 2026 18:34
SanthoshShetty (Santhosha-bk)
requested a review
from a team
as a code owner
September 7, 2026 18:34
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (75.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #6310 +/- ##
==========================================
- Coverage 85.96% 85.30% -0.67%
==========================================
Files 60 60
Lines 18976 18979 +3
==========================================
- Hits 16313 16190 -123
- Misses 2663 2789 +126 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // For unencrypted short header packets, no header protection mask will be computed, | ||
| // so avoid reading an HP sample that may extend beyond the packet. | ||
| // | ||
| CxPlatZeroMemory(Cipher, CXPLAT_HP_SAMPLE_LENGTH); |
Collaborator
There was a problem hiding this comment.
When do we expect to see unencrypted short header packets? When a connection negotiates the no-encryption custom transport parameter?
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.
Description
For unencrypted short-header packets, MsQuic does not compute a header protection mask. However, it still copied a header-protection sample from the packet, which could read beyond the packet buffer.
This change copies the sample only when header protection is needed. Otherwise, it clears the sample buffer. Encrypted and long-header packet processing remains unchanged.
https://microsoft.visualstudio.com/OS/_workitems/edit/62259370/
Testing
Documentation