Skip to content

fix(udp): validate HELLO before latch (Fixes #616) - #652

Open
Kiryuumaru wants to merge 1 commit into
masterfrom
fix/616-udp-hello-latch-spoof
Open

Kiryuumaru wants to merge 1 commit into
masterfrom
fix/616-udp-hello-latch-spoof

Conversation

@Kiryuumaru

Copy link
Copy Markdown
Owner

Summary

Security fix for #616: UDP HELLO latch spoof. The server accept path latched Connect(remote) to the first inbound datagram source before validating its content, so a spoofed or stray HELLO could hijack and lock the single accept slot, denying the real client.

Changes

  • Extract HELLO validation into new src/NetConduit.Transport.Udp/UdpHandshake.cs; gate latch/consume on valid HELLO so stray packets no longer hijack the slot.
  • Harden src/NetConduit.Transport.Udp/UdpMultiplexer.cs accept path (bounded verification window, data-proven claimant wins, rate caps).
  • Add tests/NetConduit.Transport.Udp.IntegrationTests/UdpHandshakeHardeningTests.cs (stray-packet pin) and UdpHandshakeAcceptanceTests.cs (real-client handshake).
  • Update docs/transports/udp.md handshake contract.

Linkage

Fixes #616.

Evidence

Full UDP integration suite green: 33/33 PASS (dotnet test tests/NetConduit.Transport.Udp.IntegrationTests/, net10.0, Duration ~7s), superseding the prior 28/28 report — 5 new tests added by this change, zero failures.

Spoofed or stray first datagram could latch Connect(remote) and
consume the one-shot accept slot, denying the real client.

Extract HELLO validation into UdpHandshake and gate latch/consume
on valid HELLO; stray packets no longer hijack the slot.

Add UdpHandshakeHardeningTests (stray-packet pin) and
UdpHandshakeAcceptanceTests (real-client handshake).

Updates docs/transports/udp.md handshake contract.

Fixes #616.
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.

security: UDP HELLO latch spoof - first-packet source latched without validation

1 participant