Repository navigation
RFC 9113 §6.4: treat RST_STREAM with wrong payload length as connection error - #1141
Closed
arturobernalg wants to merge 1 commit into
Closed
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
RFC 9113, section 6.4 states: "A RST_STREAM frame with a length other than 4 octets MUST be treated as a connection error (Section 5.4.1) of type FRAME_SIZE_ERROR." FrameType had RST declared with payloadErrorFatal=false, which caused a StreamException (RST_STREAM) to be sent to the client instead of a ConnectionException (GOAWAY) when the payload length was not exactly 4 bytes. Set payloadErrorFatal=true for RST so that FrameType.check() escalates the payload-size violation to a connection error, matching the RFC mandate. Update TestHttp2Section_6_4.testResetFrameWrongLength to assert the correct GOAWAY response instead of the previously incorrect RST_STREAM.
Member
Author
|
Closing as a duplicate: the same change, treating a RST_STREAM frame with a length other than 4 as a connection error of type FRAME_SIZE_ERROR (RFC 9113, section 6.4), was already merged as #1118. After rebasing onto main there is no difference left. |
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.
RFC 9113, section 6.4 states:
FrameTypehadRSTdeclared withpayloadErrorFatal=false. When a RST_STREAM frame arrived with a payload size other than 4 bytes on a non-zero stream,FrameType.check()fell into the stream-error branch and sent aRST_STREAMback to the client. RFC 9113 §6.4 requires a connection error (GOAWAY) instead.The fix sets
payloadErrorFatal=trueforRST, soFrameType.check()always throws aConnectionExceptionfor a malformed RST_STREAM payload, regardless of stream id.For comparison,
PRIORITY(§6.3) correctly usesfalsebecause §6.3 says "stream error", andWINDOW_UPDATE(§6.9) correctly usestruebecause §6.9 says "connection error".RSTwas the only frame type with the wrong setting.TestHttp2Section_6_4.testResetFrameWrongLengthis updated to expectGOAWAY(FRAME_SIZE_ERROR)instead of the previously incorrectRST_STREAM(FRAME_SIZE_ERROR).