Skip to content

[release/2.5] backport #6022: fix virtual buffer overflow in stream_recv#6071

Open
dkgkdfg65 wants to merge 1 commit into
microsoft:release/2.5from
dkgkdfg65:backport/36367b6361-rel2.5
Open

[release/2.5] backport #6022: fix virtual buffer overflow in stream_recv#6071
dkgkdfg65 wants to merge 1 commit into
microsoft:release/2.5from
dkgkdfg65:backport/36367b6361-rel2.5

Conversation

@dkgkdfg65

Copy link
Copy Markdown

release/2.5 is missing the virtual-buffer overflow fix that's on main (#6022, 36367b6). In stream_recv.c the virtual buffer length math still uses a uint32 multiply that can wrap, so a crafted receive sequence can drive the buffer accounting past its bound.

checked it on release/2.5: built the stream_recv virtual-buffer length path with -fsanitize=address on ubuntu:22.04 and drove the wrapping multiply — pre-fix the invariant check aborts / the accounting overflows, with the main fix applied the value is clamped and it's clean. (modeled the buffer-math function rather than a full msquic build.)

clean cherry-pick (-x), original author (Gaurav Singh) preserved. the generated clog headers come along with the .c change as upstream had them. happy to rebase.

note: i'll sign the CLA when the bot prompts.

upstream: 36367b6361

## Description
Changed guard condition to fix virtual buffer issue..

## Testing

NA
## Documentation

NA

(cherry picked from commit 36367b6)
@dkgkdfg65 dkgkdfg65 requested a review from a team as a code owner June 6, 2026 15:15
@dkgkdfg65

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants