Skip to content

Fix Critical Race Condition in ORDERED_ALLOW_TIMEOUT Channel Processing #1238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leopardracer
Copy link

Problem

The ORDERED_ALLOW_TIMEOUT channel type had a critical race condition vulnerability where the nextSequenceRecv counter could be incremented twice:

  1. First increment during timeout processing (lines 897-905)
  2. Second increment during normal processing (lines 925-927)

This violated the "exactly-once delivery" guarantee and could cause subsequent packets to be rejected.

Fix

  • Separated ORDERED and ORDERED_ALLOW_TIMEOUT cases in the sequence increment logic
  • Ensured immediate return after timeout processing to prevent double increment
  • Maintained correct packet ordering semantics

Security Impact

  • Critical: Fixed race condition that could break channel functionality
  • Prevents: Packet loss and channel state corruption
  • Maintains: Protocol safety guarantees

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.

1 participant