Skip to content

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

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

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

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
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.78%. Comparing base (0650625) to head (07a9dd4).

Additional details and impacted files
@@               Coverage Diff               @@
##           release/2.4    #6220      +/-   ##
===============================================
- Coverage        87.22%   85.78%   -1.45%     
===============================================
  Files               56       56              
  Lines            17348    17348              
===============================================
- Hits             15132    14882     -250     
- Misses            2216     2466     +250     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guhetier
Guillaume Hetier (guhetier) merged commit 583e7d5 into release/2.4 Aug 11, 2026
375 of 378 checks passed
@guhetier
Guillaume Hetier (guhetier) deleted the guhetier/path_uaf_2.4 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