Skip to content

[CP] Fix path migration UAF: guard path promotion with InUse check (#6217) - #6219

Merged
Guillaume Hetier (guhetier) merged 1 commit into
release/2.5from
guhetier/path_uaf_2.5
Aug 11, 2026
Merged

[CP] Fix path migration UAF: guard path promotion with InUse check (#6217)#6219
Guillaume Hetier (guhetier) merged 1 commit into
release/2.5from
guhetier/path_uaf_2.5

Conversation

@guhetier

Copy link
Copy Markdown
Collaborator

Description

Fixes a use-after-free in QUIC path migration where a stale/removed path could be promoted into Paths[0] during post-processing.

Root Cause

When QuicConnReplaceRetiredCids is called during NEW_CONNECTION_ID frame processing, it may invoke QuicPathRemove, which frees the path. However, QuicConnRecvPostProcessing later attempts to promote that same path (via the *Path pointer) if it has non-probing frames and a new largest packet number — without verifying the path is still valid.

Fix

Add a (*Path)->InUse check in QuicConnRecvPostProcessing before promoting a path to active. This ensures we never promote a path that has already been removed by QuicPathRemove.

Testing

CI and validation on a repro of the issue

Documentation

N/A

Summary

Fixes a use-after-free in QUIC path migration where a stale/removed path could be promoted into Paths[0] during post-processing.

Root Cause

When QuicConnReplaceRetiredCids is called during NEW_CONNECTION_ID frame processing, it may invoke QuicPathRemove, which frees the path. However, QuicConnRecvPostProcessing later attempts to promote that same path (via the *Path pointer) if it has non-probing frames and a new largest packet number — without verifying the path is still valid.

Fix

Add a (*Path)->InUse check in QuicConnRecvPostProcessing before promoting a path to active. This ensures we never promote a path that has already been removed by QuicPathRemove.
@guhetier
Guillaume Hetier (guhetier) requested a review from a team as a code owner August 11, 2026 16:55
@guhetier
Guillaume Hetier (guhetier) merged commit 9ff06b7 into release/2.5 Aug 11, 2026
282 of 283 checks passed
@guhetier
Guillaume Hetier (guhetier) deleted the guhetier/path_uaf_2.5 branch August 11, 2026 18:53
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