Reject zero-length TCP messages to prevent connection slot abuse (backport #71942)#72383
Open
mergify[bot] wants to merge 1 commit into
Open
Reject zero-length TCP messages to prevent connection slot abuse (backport #71942)#72383mergify[bot] wants to merge 1 commit into
mergify[bot] wants to merge 1 commit into
Conversation
) * Reject zero-length TCP messages to prevent connection slot abuse Zero-length messages (4-byte header of all zeros) were silently accepted as valid, keeping the connection alive. An attacker could hold all TCP connection slots (default: 4) indefinitely by sending just 4 zero bytes per probe, blocking legitimate CASE sessions. Reject zero-length messages and close the connection, since no valid Matter message has zero payload length. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address review: remove redundant CloseConnectionInternal, fix test - Remove explicit CloseConnectionInternal call since the caller (OnDataReceived) already handles connection closure on error return - Update test to expect CHIP_ERROR_INVALID_MESSAGE_LENGTH for zero-length messages Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Retrigger CI (REPL timeout) * Retrigger CI --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Robert Szewczyk <szewczyk@google.com> (cherry picked from commit 0e0a4aa)
|
PR #72383: Size comparison from 09d0453 to 584118b Full report (45 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, nrfconnect, psoc6, qpg, stm32, telink, tizen)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CHIP_ERROR_INVALID_MESSAGE_LENGTHon receipt of a zero-length messageTesting
CheckProcessReceivedBufferinsrc/transport/raw/tests/TestTCP.cppsends a zero-length message (messageSize_TEST) and expectsCHIP_NO_ERROR— this test will need to be updated to expectCHIP_ERROR_INVALID_MESSAGE_LENGTHand connection closure🤖 Generated with Claude Code
This is an automatic backport of pull request #71942 done by Mergify.